The main problem you have is that arrays in C have a fixed size, set when they are created, and that size cannot be changed. So there's no way to "append" to an array.
The usual way to deal with that is to create an array with a maximum size (or capacity) and track the "in use" part of the array with a separate variable (often called 'size'). At any given time, the array elements from 0 to size-1 are "in use" and valid, while those from size to capacity-1 are "free" and might contain garbage values that will be ignored.
Since the array and the size variable are so intimately connected, it is common to combine them into a struct to make things easier to manage:
#define MAX_ARRAY_SIZE 100
struct long_array {
size_t size;
long data[MAX_ARRAY_SIZE];
};
Now you can initialize an empty array with struct long_array odd = { 0 };
and you could then append to this array with
if (odd.size == MAX_ARRAY_SIZE) {
/* always check for errors or unexpected situations! */
fprintf(stderr, "array overflow\n");
exit(1); }
odd.data[odd.size++] = new_value;
of course, this will end up allocating the maximum amount for every array, so the limit needs to be fairly small. You can make this more flexible by allocating the array on the heap and storing the capacity in the array as well as the size:
struct long_array {
size_t size, capacity;
long *data;
};
but this requires more management to track when the array needs to be resized or freed.