getchar() gets a single character from the input stream and assigns it to the variable. So you can do:
Code:
#include <stdio.h>
int main (void)
{
int ch;
ch=getchar();
if (ch == 'y' || ch == 'Y')
/* rest of code */
}
The reason for int ch instead of char ch is because thats what getchar returns. C treats chars at short integers so the above comparison is legal.
Actually I was wrong to use fscanf to get the input info. I meant fgets. This is a function to get a string from a stream. scanf has a problem if you input "yes" and also will leave the newline (think the character that is sent when you press enter) in the buffer. fgets will only get the number of characters allowed by the size and will also capture the newline character if there is room.
Way to use it would be like this (for your program)
Code:
fgets ( strBoolean, sizeof(strBoolean), stdin)
Do a search and you'll be able to find a lot more information about it, I think its in the FAQ also. Look for why gets is bad.