If I have a C++ function that takes a string parameter:
void somefunc(const std::string &s)
{
std::cout << ": " << s << std::endl;
}
If I then have something like:
const char *s = "This is a test...";
somefunc(s + "test");
I get an error:
error: invalid operands of types ‘const char*’ and ‘const char [5]’ to binary ‘operator+’
How can I call somefunc
with s
plus some other string?