mirror of
https://github.com/tezc/sc.git
synced 2025-01-14 06:43:04 +08:00
31 lines
524 B
C
31 lines
524 B
C
#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));
|
|
|
|
|
|
// Simple loop
|
|
for (int i = 0; i < sc_array_size(p); i++) {
|
|
printf("Elem = %d \n", p[i]);
|
|
}
|
|
|
|
sc_array_destroy(p);
|
|
|
|
return 0;
|
|
}
|