Expression must be a modifiable Ivalue?
I am trying to put the data in buffer into sbuffer.Message. However, sbuffer is underlined red and says
expression must be a modifiable Ivalue
Here is the relevant code:
char* buffer = new char;
std::cin >> buffer;
sbuffer.ID = ID;
sbuffer.Message = buffer;
if( socket.send(&sbuffer, sizeof(buffer)+1) == sf::Socket::Done)
std::cout<<"Sending Message: "<<buffer<<std::endl;
Last edited on
You can't use the assignment operator with C-strings. You will need to use strcpy().
Topic archived. No new replies allowed.