The way I'm using to fit the words in an array is "scanfying" each letter at a time, i.e.
words: GLASS, THREE, NINE
words[1][1] = 'G', words[2][3] = 'R'; words[3][4] = 'E'...
But I want my program to read words until I press Enter, that is, words[i][j] == 10 (ASCII correspondant to Enter). I wanted to use a
break statement for that command. Unfortunately, this command exits both "for" loops, when I just want it to exit the inner loop. Any suggestions?
Code:
char words[MAX][MAX+1];
int P;
scanf("%d", &P);
for(i=0; i<P; i++) {
for(j=0; j<MAX; j++) {
scanf("%c", &words[i][j]);
if(words[i][j] == 10) break;
}
}