to try:
#include <sstream>
std::stringstream str;
str << "hello world: " << 5;
: , , . , sstream. - ( , ...):
#include <sstream>
void fun(char *buff, unsigned size)
{
std::stringstream str;
str << "hello world: " << 5;
memcpy(buff, str.str().c_str(), size);
}