D
Dan Smith
Ok, I'm stumped. Either sscanf is broken or I'm not understanding
somthing. Probably the later. Hopefully someone here can help me out
with this before I chew my own leg off.
First what I'm trying to do:
I have a line in a text file that looks like
'TYPEBE','P6','FFGHT'
and I'm trying to get the data in the between the first two quote marks
into to strings for use later in the program.
The code I'm using is:
char line[600];
char string1[7];
char string2[7];
.....
fgets (line,256,xiresults_file);
sscanf (line,"%*c%[^']s%*c%*c%*c%[^']s",string1,string2);
.....
This code sets string1 to TYPEBE, but string 2 is not being set to P6
as I expected it to. I'm probably doing something wrong, but I
just can't figure out what. Thanks in advance for the help
somthing. Probably the later. Hopefully someone here can help me out
with this before I chew my own leg off.
First what I'm trying to do:
I have a line in a text file that looks like
'TYPEBE','P6','FFGHT'
and I'm trying to get the data in the between the first two quote marks
into to strings for use later in the program.
The code I'm using is:
char line[600];
char string1[7];
char string2[7];
.....
fgets (line,256,xiresults_file);
sscanf (line,"%*c%[^']s%*c%*c%*c%[^']s",string1,string2);
.....
This code sets string1 to TYPEBE, but string 2 is not being set to P6
as I expected it to. I'm probably doing something wrong, but I
just can't figure out what. Thanks in advance for the help