If you are confused with "Array of strings" it is basically char arr[10][10];
. I'm trying to type out an array of strings using 'for' loop, and the length of that array of strings is unknown (it's variable). How do I write a 'for' loop that would know where is the end of that array of strings and stop writing? (btw if you're curious as to what I'm needing, it is for a system that reads strings from a text file line by line and puts them in an array of strings) I can however detect EOF, so right now I'm using a for loop that puts lines in an array of strings, and immediately prints it... here it is:
fp = fopen ("file.txt","r");
for(i=0;!feof(fp);i++)
{
fgets(array[i],20,fp);
printf("\n%s",array[i]);
}
fclose(fp)