The latter part, "%[;]c" is a trick to detect if the whole string is read
I'm trying to use fscanf to read a certain string, using this formatting :
The latter part, "%[;]c" is a trick to detect if the whole string is read : Only if the ";" is encountered the result of fscanf equals 2 (can't use "%n", as that doesn't up the result count).
Second question : Is there some way I can tell fscanf that it should match upto the terminating zero (so I can do away with the "%[;]c" cludge altogether) ?
If you're using fscanf there presumably isn't a terminating zero,
Of course whether this is worthwhile will depend on the details, eg
want to simply ignore and/or complain about badly formed lines, or whether you
want to abort the whole reading.
|Location:||Huddersfield, West Yorkshire, UK|
|Nodes:||16 (1 / 15)|