Scanf causes C program to crash

You must pass the address of the variable to scanf:

 scanf("%c", &answer);

Leave a Comment