I'm trying to read a file from txt docs and display the data, but when I run the code, it displays nothing and just shows like this:
I'm not sure where the problem is with my code, but perhaps the problem is because I need to display 4000 columns of data so the program cannot read and display it. I tried to use another sample txt with 10 columns of data and the code worked but not with 4000 columns of data.
This is my code :
char str [101][101];
FILE *fin = fopen ("test.txt", "r");
int count = 0;
while (!feof(fin)){
fscanf (fin, "%s", str[count]);
count++;
}
fclose(fin);
for (int i = 0 ; i < count ; i++){
printf("%s\n", str[i]);
}
This is data I want to read and display (4000 columns data)
Bali
Paris
Japan
Nepal
India
Rusia
Malaysia
Thailand
England
etc....
Thank you in advance!!