Code:
else if(in_word ==1)
{
textArray[i][j] = '\0';
i++;
j = 0;
in_word = 0;
}
}
first_word_total = i;
for(i = 0; i < first_word_total; i++)
{
for(j = 0; j != '\0'; j++)
{
textArray[i][j] = wordArray[i][j];
}
}
for(i = 0; i < first_word_total; i++)
{
for(j = 0; j != '\0'; j++)
{
printf("%s\n", wordArray[i]);
}
}
//return word_total;
I went back a put a null character at the end of the line, indicating the end of the string. Now when I run the program, it doesn't seem to copy anything, and only prints a blank list... It doesn't compare anything yet, but I'll get to that after I get the arrays to copy successfully. The bold part of the code is just to display the contents of wordArray, for debug purposes. So far nothing yet.
I've tried single and double for loops so far, but to no avail...
I'll try strcpy since there is now '\0' at the end of each line and see where that gets me.