|
-
April 23rd, 2003, 05:42 PM
#1
cin.getline hanging up
Hi,
In my program, I have something like this:
cout << "Enter something: ";
cin >> something;
...
cout << "Enter something else: ";
cin.getline (something_else, 128);
Why is it that my program hangs up on the cin.getline when I have the first cin called? If I remove the first callout of cin, then the program works fine.
I've tried cout.flush(), thinking that it might work but it didn't.
Can someone please help?
-
April 23rd, 2003, 06:14 PM
#2
just change
cout << "Enter something: ";
cin >> something;
to
cout << "Enter something: ";
cin.width( 128 );
cin >> something;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|