Computers accept input into a buffer. This means the keystroke doesn't go directly into the OS but into a block of memory where it can wait for the OS and applications programs to process it.
Now many functions, like cin or cstdio's scanf don't accept input until you hit the return key. This is not an issue for a string or char array (the ASCIIZ string) but it can be an issue for anything else. To take an example:
You have a menu program to convert between celsius and fahrenheit:
cout << "Enter 1 to convert from Fahrenheit to Celsius" << endl;
cout << "Enter 2 to convert from Celsius to Fahrenheit" << endl;
cout << "Your choice:"
cin >> char choice;
cout << "Enter a temperature to convert:";
cin >> float temp;
It accepts your choice but skips past accepting input for your variable to work on.
That is because the function demanded a letter and an enter key for choice, but only used the letter '1' or '2' and left the enter key in the buffer. The next call to cin read the enter key -- and that was that. It assumed, because it does, that you had entered temp and it should use the value it had (either 0 or some garbage left over from an earlier program).
cin.flush() clears the input buffer. It allows you to enter a value right after entering another value. By the way, the basic flush() is a member of ostreams like cout not istreams like cin in standard C++ but compilers will enable it.