2020-11-11 01:19:49 +03:00
|
|
|
#include "sc_array.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
int *p;
|
|
|
|
|
|
|
|
sc_array_create(p, 0);
|
|
|
|
|
|
|
|
sc_array_add(p, 0);
|
|
|
|
sc_array_add(p, 1);
|
|
|
|
sc_array_add(p, 3);
|
|
|
|
|
|
|
|
printf("\nRemoving first element \n\n");
|
|
|
|
sc_array_remove(p, 0);
|
|
|
|
|
|
|
|
printf("Capacity %zu \n", sc_array_cap(p));
|
|
|
|
printf("Element count %zu \n", sc_array_size(p));
|
|
|
|
|
2020-12-27 08:00:22 +03:00
|
|
|
|
2020-11-11 01:19:49 +03:00
|
|
|
// Simple loop
|
|
|
|
for (int i = 0; i < sc_array_size(p); i++) {
|
|
|
|
printf("Elem = %d \n", p[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
sc_array_destroy(p);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|