you need a stringstream to do that because you don't have anything in the class that returns the string data version of it, so you have to turn the stream operator to a string. somehow, to use +=, you need a string or something that implicitly converts to a string (char* works, string literals work, etc).
this isn't necessary, of course: you can skip the middle statement and say
cout << message << a;
which is slightly less work done and same end result.