How does the following code work?
void main()
{
printf("%d", printf("earth"));
}
This gives as output: earth5
.
The return value of printf
is the number of characters printed. The inner printf
is called first. Equivalent to:
int rc = printf("earth");
printf("%d", rc);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With