Why does a letter disappear when I'm writing the following (the problem is the underlined code.)
-
char a, b;
printf ("write two letters")
scanf("%c %c", &a,&b);printf("%c %c",b, a ); return 0;
when I run the program and press x and y for example y disappears when I use printf
Could you copy and paste the code you're running? What you've posted won't compile.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
char a, b;
printf ("write two letters")
scanf("%c %c", &a,&b);printf("%c %c",b, a ); return 0;
when I run the program and press x and y for example y disappears when I use printf
Is that a space in the middle of your
scanf
format? If so, you need to type “x(space)y”.Mircea
-
char a, b;
printf ("write two letters")
scanf("%c %c", &a,&b);printf("%c %c",b, a ); return 0;
when I run the program and press x and y for example y disappears when I use printf
-
Could you copy and paste the code you're running? What you've posted won't compile.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Is that a space in the middle of your
scanf
format? If so, you need to type “x(space)y”.Mircea