Skip to main content
gamedev.net
🔒 Locked

Cin Problem!!!

Started by Ademan555 Jan 8, 2004 at 12:26 AM 3 replies 300+ views
Original Post
Ademan555
Ademan555

	cout<<"Getting Other Person''s Name...\n";
	while(!recv(*Sock, OName, 32, NULL));
	cout<<"Their name is: "<<OName<<''\n'';

	cout<<"Please insert the name you would like to give yourself\n>";
	cin.get(UName, 32, ''\n'');     //SKips this cin.get... :-/

	send(*Sock, UName, 32, NULL);
Sock is a ptr to a socket, OName and UName are both 33 character arrays (all ZeroMemory()''d ) for some reason, it skips the marked cin.get();
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
Krumble
Krumble
Do you mean getline?
Kevin.
Ademan555
Ademan555
Yeah i meant cin.getline() sri, anyways, this is part of a server/client model to test my knowledge of the winsock api, and its been skipped because the client tells me that he doesnt get to input his name, he recieves the name i put in (using the identical function calls/order even down to the prompt) but then it skips right over his input (it tells me his name is blank) and then it goes on to messaging...

ive tried doign a cin.clear(ios::goodbit) that didnt help...
My best bet was that maybe there were some extra newlines in his buffer, but i guess not

oh btw i know whats happening on his end because we were communicating at the same time on aim

-Dan

Yes I realize im a n00b...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
Ademan555
Ademan555
No ones got any clues as to why it doesnt get the line???

-Dan

Yes I realize im a n00b...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.