Search code examples
cscanfstdio

What are the origins of the name "scanf" and the specifier "%g"?


What does the "f" in 'scanf' mean?

Also, why are double values signified by "%g" - what does the g mean?


Solution

  • My guess would be that the f means that the function takes a format specifier, as does printf().

    %g = %f + 1, I guess, as %d was taken for "decimal integer".

    Full list, with descriptions, can be found here.