Say I have an array
char messages[10][2][50];
What is the correct syntax for strcpy, in order to get the data into one of the strings (inner most char array of size 50) and then the corresponding convention to supply it to printf via %s?
For that matter, am I declaring the array subscripts in the correct order? It is intended to be 10 lots of, pairs (of 2) strings. Each string being 50 chars wide.
01{{50 chars},{50 chars}}
02{{50 chars},{50 chars}}
...
09{{50 chars},{50 chars}}
10{{50 chars},{50 chars}}
Various internet sources seem to conflict on which subscript to omit and, whatever I try seems to produce unintended results.
e.g. Could you fill in the blanks to the following
strcpy(message???, "Message 1 Part 1");
strcpy(message???, "m1 p2");
strcpy(message???, "m2 p1");
strcpy(message???, "m2 p2");
strcpy(message???, "m3 p1");
strcpy(message???, "m3 p1");
//So on...
int i;
for(i=0;i<10;i++)
printf("%s, %s\n", message???, message???);
Such that the array has a structure of and holds:
01{{"Message 1 Part 1\0"},{"m1 p2\0"}}
02{{"m2 p1\0"},{"m2 p2\0"}}
01{{"m3 p1\0"},{"m3 p2\0"}}
//So on...
And outputs as such
Message 1 part 1, m2 p2
m2, p2
m3, p3
and so on