I have a case where I\'m not sure if I\'ll get enough input for sscanf
. Can I safely assume that sscanf
won\'t mess with any argument that it doesn
The only reference I can find in C11 is for fscanf
, 7.21.6.2/10, which says:
the result of the conversion is placed in the object pointed to by the first argument following the format argument that has not already received a conversion result.
I interpret "is placed in" as "is assigned to", and I'd say with reasonable confidence that this means that an assignment happens if and only if there's a match, otherwise the recipient variable isn't touched.
Note that all of the variable argument are evaluated before the function call, of course; this has nothing to do with scanf
.