You must pass the address of the variable to scanf:
scanf("%c", &answer);
More Related Contents:
- decimal of numbers in c
- scanf() not taking input from console [closed]
- C program goes into infinite loop with scanf [duplicate]
- How to read these mixture of data in C
- scanf() leaves the newline character in the buffer
- fgets doesn’t work after scanf [duplicate]
- Why is scanf() causing infinite loop in this code?
- What can I use for input conversion instead of scanf?
- Simple C scanf does not work? [duplicate]
- scanf Getting Skipped [duplicate]
- Why does reading into a string buffer with scanf work both with and without the ampersand (&)?
- C skipping one command of a function? [duplicate]
- abnormal behavior of scanf [duplicate]
- using scanf(“%d “) with a space after the %d
- Difference between scanf and scanf_s
- How to scanf only integer?
- What will happen if ‘&’ is not put in a ‘scanf’ statement?
- Read no more than size of string with scanf()
- Why does scanf fail with floats?
- Input in C. Scanf before gets. Problem
- Problems with C scanf(“%c”) function to read characters one by one
- How do we test the return values from the scanf() function?
- What does `scanf(“%*[^\n]%*c”)` mean?
- Whitespace before %c specification in the format specifier of scanf function in C
- using scanf function with pointers to character
- Wrong format specifiers in scanf (or) printf
- Format specifier in scanf for bool datatype in C
- C: How can I make it so scanf() input has one of two formats?
- Equivalent to Windows getch() for Mac/Linux crashes
- Difference between scanf() and fgets()