Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strigns and More strings....

Status
Not open for further replies.

cmolson6

Programmer
Dec 17, 2001
1
CA
i have a question concerning this code:
void LCDif::m_Entm()
{
cout<<&quot;Enter your message now: &quot;<<endl;
cin.getline(arcMess,100);
cin.getline(arcMess,100);

}


there is also a menu system before this member function. I would like to know why is i only use one cin.getline.. it will not even prompt me to enter in the array, but if i use two it works great.. any ideas? (before i go to this fnction i get the user to enter some intergers for a basic menu system)

Thanks for your Help
 
I think it's possible there's a carriage return left in the buffer when you get to the first cin.getline(). If that's the case, it may pick up the carriage return so quickly that the prompt flashes for only an instant and goes away. It's probably related to the previous user input from the menu system.

What does your menu system user input routine look like?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top