Home Forums C Programming Help – file reading Re: Re: Help – file reading

#3532
msaqib
Participant

Use fgets() function to read the file line by line and then split the string and store all the values in variables.


int x = 0;
while (fgets(msg,25,fp)!=NULL)
{
x++;
if(x==0){
//we do not need to read first line as it contians headings
//this is the first line which you don't need to read and you can hardcode it in progrm
}
else{
//write your rest of the program here to read the data and manipulate
}

}