title: IRC Client Sending Messages Improperly, C++
body: <p>The problem occurs when sending messages. They segment into individual messages where spaces are. The messages are composed using <code>sprintf(message, "PRIVMSG %s :%s\n", irc_chan, buffer);</code> The error will appear as follows(Individual messages are contained in <code>""</code>s). I will enter a message <code>"Hi there"</code>. It will output <code>"Hi"</code> <code>"there"</code>. buffer is a <code>char[1024]</code>. Any ideas please let me know.</p>
  
  <p>The following is the part of the code that sends the message, the class I've used for the socket is of no concern to you, I can receive messages and connect FINE.</p>
  
  <pre><code>scanf("%s", buffer);
  sprintf(message, "PRIVMSG %s :%s", irc_chan, buffer);
  send(IRCSocket.iSocket, message, strlen(message), 0);
  </code></pre>
  
  <p>EDIT: I resolved this with help from Computer Guru. I was using scanf(), I should have been using cin.getline(); Thanks for the help, MUCH appreciated.</p>