I want to create string
"hello1world
by this two strings:
string s1 = "hello"
string s2 = "world"
I do this:
string my_str;
sprintf(my_str, "%s1%s", s1, s2);
But I have an error:
error: cannot convert ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ to ‘char*’ for argument ‘1’ to ‘int sprintf(char*, const char*, ...)’
sprintf(my_str, "%s1%s", s1, s2);
How to do it properly?