How to read the data line by line?Though simple one,Iam in confusion.Pls help me.
In Dialog1, for File.txt ,writing the names as
Name1
Name2
Name3
and on the other side I want to read the names one by one,but In Dialog2 always reading the Name1,not going to the second line.
In Dialog1
Quote:
unsigned char* data[100];
//Open a File and write the data
FILE *pFile;
pFile = fopen ("File.txt","w+t");
for(TInt i=0;i<10;i++)
{
if(pFile!=NULL)
{
//write the data to File
fscanf(pFile,"%s\r\n",data);
fprintf(pFile,"%s\r\n",data);
}
}
Quote:
//Open a File and read the data
FILE *pFile;
pFile = fopen ("File.txt","r+t");
for(TInt i=0;i<10;i++)
{
if(pFile!=NULL)
{
fscanf(pFile,"%s\r\n",data);
}
}

