I made a little test with folloeing code and get output as expected
Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE* file;
int i =0,no;
char str1[BUFSIZ],str2[BUFSIZ],str3[BUFSIZ];
file = fopen("test.txt","r");
while(fscanf(file,"%s %s %s %d",str1,str2,str3,&no) ==4 )
{
i++;
}
fprintf(stdout,"%s %s %s %d",str1,str2,str3,no);
fprintf(stdout,"\nTotal number of lines: %d",i);
system("PAUSE");
return 0;
}
This little test works for me. Note that & is not needed in printf and check FAQ about using feof()
Try printing playlist[0].code and group separately just to make sure everything is stored correctly...
- Micko