Based on my last series of posts which you needn't read, I now need a new method of creating a dynamicly expanding global array. I suspect I won't get one, which would be COMPLETELY RIDICULOUS and makes me wonder how anyone has managed to do anything significant in C at all.
Here's the issue: I want to read in a text file consisting of lines like this
bob 3874 habit
scram 9984 sweater
flux 12 then
so each line ends up in a struct like this:
However, the number of such lines is indeterminate, so "ray[3]" won't work. This must be a common task. How can I create an array of structs that will grow when I add a new entry, so to speak? Or do I have to (COMPLETELY RIDICULOUS) have to just set ray[10000] or something, to make sure I have enough space?Code:struct info {
char *name;
int *num;
char *also;
} ray[3];