// // Example 11.2, version 2 // Program to illustrate string input with getline // #include using namespace std; int main() { const int MAX_LENGTH = 255; char str[MAX_LENGTH + 1]; // string char ch; // character cout << "Type something:"; cin.getline(str, MAX_LENGTH + 1); cout << ":" << str << ":" << endl; cout << "We need the next character:"; cin.get(ch); cout << "Next character:" << ch << ":Done" << endl; return 0; }