I've implemented my own dynamic array data structure in c and now i am looking for a way to fill them up without losing their dynamicity.
If i write something like
char str[ANY_CONSTANT];
fgets(str, ANY_CONSTANT, stdin);
The number of elements i can pass to my program is defined at compilation time, which is exactly what i do not want to happen.
If i write something like
char str[ANY_CONSTANT];
scanf("%s", &str)
I have the same situation. Is there any function that i can use to input data from the keyboard without any fixed dimension? Thanks in advance!