FILE *fp;
int rows=0, idx;
char f_content[10][80];
//This array will hold the contents.
//ASSUMING a line in the text file wont exceed 79 chars.
if(!(fp=fopen("TextFile.txt","r")))
{
printf("\n\tError opening file...");
exit(0);
}
while(!feof(fp) && rows<10)
fgets(f_content[rows++],80,fp);
fclose(fp);
printf("\n\tContent read from the file are...\n");
for(idx=0; idx<rows;idx++)
printf("\nROW%d:%s",idx,f_content[idx]);
printf("\n=================End of Data==================\n");