I was wondering that if someone gave me an input file of many words:
Such as: "AB1CDE1 FG2HIJ2 KL3MNO3"
and I wanted to put each word into a char array in which the resulting outputs would be:
printing this ->
- array[0] = "AB1CDE1"
- array[1] = "FG2HIJ2"
- array[2] = "KL3MNO3"
I would need to allocate memory for this is what I understand.
So if I use char *array = (char*)malloc(sizeof(*array) * num_arrays) wouldn't this only give me the first values of each input given to me?
How would I initialize this array to store all the values in each array?
(I'm new to C coding so might be a really easy question.)