Hi again!
I am still learning C and I'm having some trouble figuring out how to handle this. Well, I have two structs:
struct myStruct {
...
struct myString *text[5];
...
} allStructs;
struct myString {
char part[100];
};
The objective is to have allStruct[n]
point to 5 different parts of a text divided into lines of 100 chars each. So I allocate the space:
allStructs = calloc(n, sizeof(allStructs));
Then, assume that I have a filled char text[500]
that I want to divide into 5 parts, and have allStructs[n].text[n].part
point at a given part of the text. Can anyone help me with how I proceed?