What does the return value of printf represent in C89 and C99?
Is it different or not?
What does the return value of printf represent in C89 and C99?
Is it different or not?
The integer that printf returns is the number of characters printed minus the terminating zero, or a negative value if an error occurs. The return value didn't change; if it did, the man page would have been updated.
It's the same, of course. C99 does not contain any such subtle backwards incompatibilities. I don't think it contains any incompatibilities at all.
printf() returns the number of characters actually written.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law