Original Post
I dont get it, it skips right through the cin.get statement
This is the main loop in the program, message being a char [128]
s is a socket (that works)...
when I run it like this, if i put more than one word, it adds an empty "message to be sent:" queue (skips it). What the other side receives is ''(the first word) (\n) (all the rest without spaces)''
for example if i wrote: "hello willing world"
it would put 2 empty prompts
the other side would display:
hello
willingworld
do
{
cout << "Message to be sent: ";
cin >> message;
cout << endl;
if(message[0]!= ''\0'')
send(s, message, (int)strlen(message),0);
if(ret == SOCKET_ERROR)
{
cout << "Message sending error occured" << endl;
system("Pause");
end = -1;
break;
}
}while(true);
visual studio.net
c/c++ (obviously)
i don''t mind giving the full source if needed, its not that long