View Single Post
  #2 (permalink)  
Old July 17th, 2004, 06:16 PM
Tez Tez is offline
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try the following:

#include <iostream>

using namespace std;

int main()
{
    const int str_len = 80;
    char words[str_len];
    //int borb;

    cout << "Enter Input: ";
    cin.getline(words, str_len, '\n');
    //cin >> borb;

    cout << words << endl;

    return 0;
}

I've commented out the "cin >> borb;" statement as that was your problem - it's requesting another value. The getline() function has already completed all the input but the program is waiting for the next cin statement to be satisfied.

Tez
Reply With Quote