So this is my loop:
The point is that is should loop back if the User pressed a worng button.Code:int main() { char Button; do{ printf("Press E \n"); scanf(" %c", Button); }while(Button != 'E'); printf("Good"); return 0; }
So this is my loop:
The point is that is should loop back if the User pressed a worng button.Code:int main() { char Button; do{ printf("Press E \n"); scanf(" %c", Button); }while(Button != 'E'); printf("Good"); return 0; }
You need to pass the address of Button, rather than the value of Button to scanf.
What can this strange device be?
When I touch it, it gives forth a sound
It's got wires that vibrate and give music
What can this thing be that I found?
The '&' symbol is used as the address-of operator in C. Place it in front of Button, in the call to scanf, but nowhere else in your program.
What can this strange device be?
When I touch it, it gives forth a sound
It's got wires that vibrate and give music
What can this thing be that I found?
Please format your code before presenting here. Try to avoid extra blank lines also.
Please not the changes I made to your code.
Code:#include <stdio.h> int main(void) { char Button; do{ printf("Press E \n"); scanf(" %c", &Button); }while(Button != 'E'); printf("Good\n"); return 0; }