What you need is a dynamically allocated/sized array that isn't natively supported by the language but you can create one for yourself. Since you are a beginner I would recommend you to write an array that doesn't reallocate its storage as needed. By leaving out memory management you make your task simpler. Its ok to bother with memory management later when you are better at the C language. Without memory management your dynamically sized array will be a combination of a fixed size array and an integer that indicates how many items are valid in the array (of course at the beginning of the array). The rest of the items are unused. Without memory management this array has a limit on the maximum size and it occupies that maximum size all the time even if the list is empty. Still, as a first try it is simpler to implement.
#define MAX_ARRAY_LEN 20
typedef struct MyArray
{
size_t length;
int items[MAX_ARRAY_LEN];
} MyArray;
void MyArray_Init(MyArray* arr)
{
arr->length = 0;
#if _DEBUG
memset(arr->items, 0, sizeof(arr->items));
#endif
}
void MyArray_Add(MyArray* arr, int item)
{
assert(arr->length < MAX_ARRAY_LEN);
arr->items[arr->length] = item;
++arr->length;
}
void MyArray_Remove(MyArray* arr, size_t index)
{
assert(index < arr->length);
memmove(&arr->items[index], &arr->items[index+1], (arr->length-index-1)*sizeof(int));
--arr->length;
}