• Advertisement

Archived

This topic is now archived and is closed to further replies.

cin.get

This topic is 5406 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

void new_game()
{
	cout << "Enter Diffacalty (1-10)\n";
	cout << "|: ";
	cin >> diff;
	cin.get();
	cout << "Enter The Armies Name\n";
	cout << "|: ";
	getline(cin, aname, ''\n'');
	cout << "Enter The Commanders Name\n";
	cout << "|: ";
	getline(cin, cname, ''\n'');
	game_write();
}
 
after you put in the armies name it takes 2 spaces 2 go 2 the next one, how do you get rid of the second space?? Easy way of programming: Code, Graphics, Swearing....

Share this post


Link to post
Share on other sites
Advertisement
hmm Im trying 2 get the service pack the link is wrong and I can''t find it anywere and the string.h dosn''t have that line?
v6, any help?

Easy way of programming: Code, Graphics, Swearing....

Share this post


Link to post
Share on other sites
hahah flush the stream. You do it by adding
cin.ignore(80, ''\n'');

us it after EVERY cin >> or getline or cin.get statement.

Share this post


Link to post
Share on other sites
can someone give me the link to the patch.
or the link to the file I have 2 edit.

Easy way of programming: Code, Graphics, Swearing....

[edited by - XDarkScar on April 29, 2003 4:01:21 PM]

Share this post


Link to post
Share on other sites
man, well this C++ program is from 1995-98...I don''t think is has .net so I can''t fix it...

Easy way of programming: Code, Graphics, Swearing....

Share this post


Link to post
Share on other sites
I am, but I can't find the file...
can you give me the link to the file?

edit: the link of the directory is not there..I did a search for string.h and found it in

C:\Program Files\Microsoft Visual Studio\VC98\Include
^
after seeing that I know I got an old version....
and it dosnt have that text..

Easy way of programming: Code, Graphics, Swearing....

[edited by - XDarkScar on April 30, 2003 2:09:28 PM]

Share this post


Link to post
Share on other sites

  • Advertisement