All functions return some value. Does it mean that even printf and scanf which are functions in C return some value? If so what is the value returned by these functions.
Printable View
All functions return some value. Does it mean that even printf and scanf which are functions in C return some value? If so what is the value returned by these functions.
Yes. As all functions return value so are these functions. I am not aware about scanf but printf returns the number of characters printed by the printf function. Hope we get to know about the return value of more functions in this discussion.
printf returns the number of characters that it prints, whereas scanf returns the number of format specifiers being passed to it in the format string.
Correct me if i am wrong...
[QUOTE=janelyn;991]All functions return some value. Does it mean that even printf and scanf which are functions in C return some value? If so what is the value returned by these functions.[/QUOTE]
ya printf and scanf also return values.
print return no of character printed successfully or negetive value if an error occured.
scanf return no of argument that are inputed or read .