// // Example 11.3. Program to illustrate problems with // mixing >> and getline // #include using namespace std; int main() { const int MAX_LENGTH = 255; int age; int height; char name[MAX_LENGTH + 1]; cout << "Your age: "; cin >> age; cout << "Your name: "; // ERROR - flush buffer first cin.getline(name, MAX_LENGTH + 1); cout << "Your height in inches: "; cin >> height; return 0; }