skipping a code of line

Started by
5 comments, last by TheOne1 19 years, 10 months ago

// global variable

char *sName[ 1 ];
//


...
....

void set_characterNameAgeSex()
{
	char setName[ 50 ];
	char *sTransfer;
	short setSex;
	short setAge;

	// set name

	cout << "Enter a name for your character(50 char. max): ";
	cin.getline( setName, 49 );

	sTransfer = setName;
	sName[ 0 ] = sTransfer;
I can't figure out why the program is skipping the line: cin.getline( setName, 49 ); It print the cout before that but skips user input.... Please help. Thanks in advance for replies.... EDIT: whoops! Title should be: Skpping a line of code. lol. [edited by - TheOne1 on June 4, 2004 11:08:05 PM]
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
Advertisement
Are you using MSVC 6? If you are, there''s a known bug in basic_istream::getline() with MSVC 6. Try applying the fix at this page and see if it solves your problem.
Thanks, but I've applied that fix many times, and I just did it again, but nothings changed. It still skips the cin.getline line.

Any other suggestions?

edit: Ok, on the fixes page, it says to replace snextc with sbumpc but since I have VC++ 6.0, I changed to to stossc. Do I change just that one line, or should I change all the snextc's to stossc?

also, in my file, there is a line like this:
else if (_Tr::eq((_E)_C, _D))
but the fixes page has the line like this:
else if (_Tr::eq(_C, _D))

should I change it or leave it?


[edited by - TheOne1 on June 4, 2004 11:38:19 PM]

[edited by - TheOne1 on June 4, 2004 11:45:57 PM]
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
please help....
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
quote:Original post by TheOne1
Ok, on the fixes page, it says to replace snextc with sbumpc but since I have VC++ 6.0, I changed to to stossc.


Umm...this fix is specifically for VC++ 6.0... so you should probably replace snextc with sbumpc, not stossc. Uhh...wow, what a concept, doing something other than what it tells you to and wondering why it doesnt work.


"I am free of all prejudices. I hate everyone equally." - W. C. Fields

[edited by - Lord Hen on December 2, 2008 2:32:49 AM]
quote:Original post by Lord Hen
quote:Original post by TheOne1
Ok, on the fixes page, it says to replace snextc with sbumpc but since I have VC++ 6.0, I changed to to stossc.


Umm...this fix is specifically for VC++ 6.0... so you should probably replace snextc with sbumpc, not stossc. Uhh...wow, what a concept, doing something other than what it tells you to and wondering why it doesnt work.


"I am free of all prejudices. I hate everyone equally." - W. C. Fields

[edited by - Lord Hen on December 2, 2008 2:32:49 AM]


....its amazing how people can be rude to each other (subtly or not) when they don't see each other face to face.

Anyways, if you see on the fixes page it says:
Note that V6.0 replaces snextc with stossc. It is an adequate fix, but you can also apply the above patch safely.

I know it doesnt say replace with stossc, but when I checked it, it was snextc instaed of stossc.


[edited by - TheOne1 on June 5, 2004 3:19:58 PM]
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
Since you seem to like to make things more complicated than they are, I suggest replacing the dinkumware implementation of STL with STLport. Problem solved.


[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
[size=2]

This topic is closed to new replies.

Advertisement