But 'y' and 'n' are not integers - they are characters entered from the keyboard. How do we store characters?
char ch;
This declaration allocates a cell that can hold exactly one
character:
We can assign characters to this cell using character constants:
ch = 'y';
We can also read a single character from the input by using
the %c conversion specifier in the format string given to scanf():
scanf("%c", &ch);
We could then compare the character read:
if( ch == 'y' ) keep_playing = TRUE;
else keep_playing = FALSE;
The modified code is in
guess.c.