Since you’re not reading from the stream it seems much more flexible.
Both to mention that since you can easily change the timing/code location of the reads then you can with a c stream(am I wrong, can you make strings, ect into c FILE * streams)?
Plus, I don’t know I just feel a bit odd about scanf. Any pros/cons to scanf would be appreciated.
Edit: I meant the use of scanf or fscanf vs the combo of fgets+sscanf
This is well addressed in the C FAQ.
If you are reading from a trusted file (NOT
stdin), there’s no point in usingfgets + sscanfinstead offscanf. Indeed usingscanf(reading fromstdin) is problematic.