Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Network
»
sf::Packet and std::string space causes to break text up?
Print
Pages: [
1
]
Author
Topic: sf::Packet and std::string space causes to break text up? (Read 2268 times)
0 Members and 1 Guest are viewing this topic.
Mars_999
Full Member
Posts: 103
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
»
Logged
Laurent
Administrator
Hero Member
Posts: 32498
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.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Network
»
sf::Packet and std::string space causes to break text up?