I want to store my file data in array??
List.txt contains
Xyz Abc
Lmn Pqr
Hij Klm
#include <stdio.h>
#include<conio.h>
int main()
{
FILE * pFile;
char mystring [100];
pFile = fopen ("c:\\List.txt" , "r");
if (pFile == NULL) perror ("Error opening file");
else
{
while(!feof(pFile))
{
fgets (mystring , 100 , pFile);
puts (mystring);
}
}
fclose (pFile);
getch();
}
But i want to store each string in 2d matrix
like mat[0]=Xyz
mat[1]=Abc
How to do it??