The output for this code snippet is %s is a string is a string. Please explain.
#include <stdio.h>
#define scanf "%s is a string"
int main()
{
printf(scanf, scanf);
}
What exactly do you want us to explain? Subsititute the macro and get
printf("%s is a string", "%s is a string");
The rest is the expected normal everyday behavior of printf.
P.S. #define scanf ...???
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