I have the following cout statement. I use char arrays because I have to pass to vsnprintf to convert variable argument list and store in Msg
cout
vsnprintf
Msg
You can replace cout by a stringstream.
std::stringstream buffer; buffer << "Text" << std::endl;
You can access the string using buffer.str().
buffer.str()
To use stringstream you need to use the following libraries:
stringstream
#include #include #include