Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Packet and std::string space causes to break text up?  (Read 1874 times)

0 Members and 1 Guest are viewing this topic.

Mars_999

  • Full Member
  • ***
  • Posts: 103
    • View Profile
    • Email
sf::Packet and std::string space causes to break text up?
« on: April 09, 2012, 01:05:58 am »
I am not sure why, but if I take input and send it as a packet with a space in the string, the packet only sends data up to the space and breaks off the rest of the string?

Any ideas?

Thanks!

SFML2.0 and VS2010
« Last Edit: April 09, 2012, 01:09:45 am by Mars_999 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: sf::Packet and std::string space causes to break text up?
« Reply #1 on: April 09, 2012, 10:19:11 am »
It's not the packet, it's the >> operator on istream which stops at whitespace. Use std::getline to read a string until a custom delimiter.
Laurent Gomila - SFML developer