Allan Bruce said:
Warning, untested:
sscanf( yourstring, "FL:%[^:]:%d:%[^\n]\n", lGuid, &lID, lFileName);
If the ':'s might be surrounded by whitespace that should be ignored,
you'll have to match and discard that, too.
HTH
Regards
I tried:
sscanf(xiBuffer, "FL:%d:%[^:]s:%d:%[^\n]s\n", [....]
^ ^
You've got two spurious s characters at the indicated positions.
the lGUID gets read fine, but nothing after this gets read. Where can I
find information about these scan types?
Hm, RTFM? ;-)
Seriously, your implementation should provide a documentation of the
standard library functions. Alternatively, buy the C standard, or,
if you're short on money, retrieve a copy of the final public draft
for free at:
http://anubis.dkuug.dk/jtc1/sc22/wg14/www/docs/n869/ .
As a starter, here's an excerpt from the *scanf function description:
ISO/IEC 9899:1999
7.19.6.2 The fscanf function
[...]
[ Matches a nonempty sequence of characters from a set of expected
characters (the scanset). If no l length modifier is present, the
corresponding argument shall be a pointer to the initial element of
a character array large enough to accept the sequence and a
terminating null character, which will be added automatically.
[...] The conversion specifier includes all subsequent characters
in the format string, up to and including the matching right
bracket (]). The characters between the brackets (the scanlist)
compose the scanset, unless the character after the left bracket is
a circumflex (^), in which case the scanset contains all characters
that do not appear in the scanlist between the circumflex and the
right bracket. [...]
HTH
Regards