November 11, 2018
Scanning unsigned types in C
printf and scanf are the C standard library functions for printing out and reading in data. They have string counterparts, prefixed with s, which work on strings (sprintf and sscanf). All these functions use a format string to match parts of the string with C variables. As an example, %lu in the format string corresponds to an unsigned long, a positive integer type in C.
Scanning unsigned types What happens if you try to sscanf a negative number using %lu?
Read more