Sign in to follow this  

String problem

This topic is 2545 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi ,
i got a struct and some code:

struct Player {

std::string name;

int x;
int y;
...
};

player p;

void main(){

char pname[20];
printf("Enter name :");
cin.getline (pname,20);

p.name = pname;

}

I then send the struct p to a server, but when the packet returns the string disapears (all other normal data sent and recieved is fine).

Can we send strings with sockets ?

thx for replys :)

Share this post


Link to post
Share on other sites

This topic is 2545 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this