"Content-length: "
That is a string and this:
BUFFER.length()
equates to an int. So when you use the + operator between the two are you trying to concatenate an int onto the string or are you trying to add an int to a string or are what are you trying to do? You could output both like this:
cout << "Content-length: ";
cout << BUFFER.length();
but everything between the << and ; operators in this line:
cout << "Content-length: " + BUFFER.length();
is considered one object so it has to be compatible one way or the other.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
Try another example so we can understand better what you are trying to do.
This:
cout << 4 + 7;
works fine as does this:
string word1 = "hello";
string word2 = " world";
cout << word1 + word2;
but I'm not sure what you are thinking about.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396