Hello again,
I need to find out a way to make it so the program reads characters from keyboard and watches for escape sequences. Characters are easy to input but what are the variable data types for escape sequences? Here's my code sample
Code:
void main (void)
{
char char_input;
printf ("\nPlease enter a character: ");
scanf ("%c", &char_input);
switch (char_input)
{
case '\t':
printf ("\n\nYou have entered 'TAB'.");
break;
case '\r':
printf ("\n\nYou have entered 'ENTER'.");
break;
default:
printf ("\n\nYou have entered '%c'.", char_input);
break;
}
}
Obviously, data type char would work for any character keys but seems like they won't work for escape sequences. I'm guessing I'd need some kind of new data type but not sure what it is.
Thanks.