1
Network / having issues using std::string when sending a packet using tcp
« on: November 26, 2021, 03:08:56 pm »
hi im having issues trying to send a string in a packet.
my code for trying to set up the and send a string is copied of the website however i get an error "Unhandled exception at 0x75F2EA32 in SocketsAndSFML.exe: Microsoft C++ exception: std::length_error at memory location 0x00C0FA50." when is attempts to pack the data into the packet. ie. my code:
sf::Uint16 x = 10;
std::string s = "hello";
double d = 0.6;
sf::Packet packet;
packet << x << s << d; <-------(this is where im getting the error)
thanks for your time and any help would be greatly appreciated
my code for trying to set up the and send a string is copied of the website however i get an error "Unhandled exception at 0x75F2EA32 in SocketsAndSFML.exe: Microsoft C++ exception: std::length_error at memory location 0x00C0FA50." when is attempts to pack the data into the packet. ie. my code:
sf::Uint16 x = 10;
std::string s = "hello";
double d = 0.6;
sf::Packet packet;
packet << x << s << d; <-------(this is where im getting the error)
thanks for your time and any help would be greatly appreciated