I wrote up a quick memory reader class that emulates the same functions as fread
and fscanf
.
Basically, I used memcpy
and increased an internal pointer to read the data like fread
, but I have a fscanf_s
call. I used sscanf_s
, except that doesn't tell me how many bytes it read out of the data.
Is there a way to tell how many bytes sscanf_s
read in the last operation in order to increase the internal pointer of the string reader? Thanks!
EDIT:
And example format I am reading is:
|172|44|40|128|32|28|
fscanf reads that fine, so does sscanf. The only reason is that, if it were to be:
|0|0|0|0|0|0|
The length would be different. What I'm wondering is how fscanf knows where to put the file pointer, but sscanf doesn't.