|
-
getline(cin, str_Var, '\n') doesn't work
HI, guys, once again I have a problem for which i'm seeking a solution.
I'm writing a program, a part of which prompts a user to enter "title" and "Author" as strings.
I'm using getline(cin, str_Var, '\n') like this:
cout<<"Enter Title: ";
getline(cin, str_Var, '\n');
str_Title=str_Var;
cout<<"Enter Author: ";
getline(cin, str_Var, '\n');
str_Author=str_Var;
When the program runs I have to press "ENTER" twice to pass the first getline operator, and it doesn't save the str_var to str_title, but put's it into str_author after secong getline...
I tried using cin.ignore();
but that doesn't help.
I also installed SP5 for vis studio 6...
HELP PLEASE this thing is killing me !
------------------
There are no stupid questions, there are stupid answers.
There are no stupid questions, there are stupid answers.
-
Mako Shark
that's a known bug... vc++ isn't the best compiler *sigh*
this tells u how to fix it http://www.msoe.edu/~taylor/resources/msvc60.htm
------------------
So easy to use, no wonder it's number one!!!
Where do you want to go today?
Member of NT Jocks
Tesla coils are not weapons
-
Hey, thanks man. Too bad i can't change this file here in college, but I'll try it at home.
------------------
There are no stupid questions, there are stupid answers.
There are no stupid questions, there are stupid answers.
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
|
|