Hi,
I'm doing a program that read a file, then put the first line in a string. Here is a part of my file
as I said, the line is put in char line. I want sIdentif to contain the string HRSUP, fRegle to contain the float 40.0000 (this is the only one that work), sType to contain the string CIE and sDescript to contain qqq qqq qqq.Code:TXSYN 0.0078 CIE qqq qqq qqq
when I ask him to display char line, he do the job fine (which mean the reading is alright, but when I do the printf after my sscanf, he show stuff likeCode:char sIdentif[6];
float fRegle;
char sType[4];
char sDescript[50];
char line[BUFSIZ];
sscanf (line, "%s %s %d %s",sIdentif,&fRegle,sType,sDescript);
printf ("%s %s %d %s",sIdentif,&fRegle,sType,sDescript);
as you can see, the only one working is fRegle.Code:000 0.0078 2293032
If someone can help me do this right, it would greatly be appreciated.
thanks