get rid of rest [Archive] - C Board

PDA

View Full Version : get rid of rest


pode
10-20-2003, 03:30 PM
hi
im making a small chat program, im sending a string
that the user tyes in but i want to get rid of the rest that
is stored in the string after the user has typed in his message
so only the string that the user typed will be sent i think its some cin funktion but i dont remember it.

Hunter2
10-20-2003, 06:55 PM
I'm making a small chat program. I'm sending a string
that the user tyes in, but I want to get rid of the rest that
is stored in the string after the user has typed in his message,
so that only the string that the user has typed will be sent. I think it's some cin function, but I dont remember it.Grammar, punctuation, spelling, etc. corrected by Hunter2.

char buf[MAX_STRING_SIZE]
cin.getline(buf, MAX_STRING_SIZE)

send() only what you want to send. See parameter #3, len, on MSDN. (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/send_2.asp)