The following code snippets are from a c program.
The user enters Y or N.
char *answer = '\0';
scanf (" %c", answer);
if (*answer == ('Y' || 'y'))
//do work
I cant figure out why this if statement doesn't evaluate to true.
I checked for the y or n input with a printf and it is there so I know im getting the user input. Also when I replace the the condition of the if statement with 1 (making it true) it evaluates properly.
any ideas?
thanks