Talk:C Programming/Simple Input and Output

Q: why not use the  functions cin and cout ?

A: You're thinking of. Those functions don't work in ANSI C. They're C++ thingies. (I often wish I could use them in plain C, but I can't -- go to Programming:C plus plus if you want to talk about them.)

The abridged list of I/O format specifiers appearing on this page is incorrect, and is inconsistent with the more comprehensive list, which appears in the File I/O section:--


 * %i and %d - int    (ok)
 * %f - float         (wrong: "%f" is "double" - "float" gets promoted to "double" in the function call)
 * %lf - double       (maybe, but the "l" qualifier is meaningless with "%f", and some printf or scanf implementations may choke on it; did you mean "%Lf", which is "long double" in C99?)
 * %s - string        (ok)
 * %x - hexadecimal   (only partially correct; the data type is "int"; the representation is "hexadecimal")

fflush(stdin)
This will result in undefined behavior, so why it's mentioned as a thing that flushes stdin's buffer?