If you use cin's override of the >> operator, you will only be able to get access to one character at a time. However, cin has other methods, namely getline().
istrea::getline is used as follows:
#include <iostream>using namespace std;int main( ) { char buffer[3]; cin.getline( buffer, 2 ); cout << buffer << endl;}
The above creates a buffer 3 characters long. (2 for the characters, 1 for a terminating null character).
Then cin.getline requests up to 2 character from the console and stores it in buffer.
Then you can use buffer[0] to check the first character, and buffer[1] to check the second character. You can also use strlen(buffer) to determine the number of characters in buffer.
So you know, I viewed that problem as more extra credit than anything. But it was one of the cooler things we did, due to being able to see color changes, etc...
As for enums, in C++ enums are just a way to define symbolic constants for literal constants. Their use is primarily to make code more readable, as you can do a comparison against the enum values, and you can assign the enum values rather than littering a program with literal constants (aka. magic numbers).
In other languages, where enums are classes, they have more uses, such as providing type safety and bounds checking against valid values.
Hope that answers your questions. Cheers!