Jump to content
  • Advertisement

Archived

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

TheOne1

skipping a code of line

This topic is 5279 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

// 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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!