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....
cin.get
I assumed you''re using VC6, your problem is most likely the faulty dinkumware STL.
The fixes can be found here. There are two issues with getline that need to be repaired.
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
The fixes can be found here. There are two issues with getline that need to be repaired.
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
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....
v6, any help?
Easy way of programming: Code, Graphics, Swearing....
hahah flush the stream. You do it by adding
cin.ignore(80, ''\n'');
us it after EVERY cin >> or getline or cin.get statement.
cin.ignore(80, ''\n'');
us it after EVERY cin >> or getline or cin.get statement.
getline bug patch
Moo moo MOO moo moo
Edit: oops, didn't see Wild_Pointer's the link above. I've patched this before, it works fine after.
[edited by - Bovine Supremacy NOW on April 29, 2003 3:17:55 PM]
Moo moo MOO moo moo
Edit: oops, didn't see Wild_Pointer's the link above. I've patched this before, it works fine after.
[edited by - Bovine Supremacy NOW on April 29, 2003 3:17:55 PM]
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]
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]
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....
Easy way of programming: Code, Graphics, Swearing....
Are you using Visual C++ 6? If so, the fixes are very clearly explained in the link I gave.
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
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]
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]
Where did you see it tell you to edit string.h? The file you are looking for is ''string'' (no extension) in that same directory.
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement