I'm trying to parse a file that another function has written with this fprintf:
fprintf(file, "DS;%s;%ld;%ld;%u\n", ds->name, ds->start, ds->period, ds->size)
I'm using this fscanf:
fscanf(file, "DS;%[^;$]s;%ld;%ld;%u", file_name, &file_start, &file_period, &file_size)
file_name is read with no problems. but file_start, file_period and file_size are always 0, even if not expected.
For exemple, the string:
DS;failures;1363978800;600;144
Is parsed like this:
What am I doing wrong?
replace the string format "%[^;$]s" by this %[^;$] ==> remove the s because [] replace the s so no need any more for s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With