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
|