When I try to connect string objects with other strings i'll get a "basic_string" which is not accepted by my method.
I got the following error:
error: no matching function for call to ‘Class1::doSomething(std::__cxx11::basic_string)’
My main class:
using namespace std;
int main() {
string s = "test";
Class1* class1 = new Class1();
class1->doSomething("some text " + s + " too");
}
My "class1":
using namespace std;
class Class1 {
public:
void doSomething(const char* sql) {
mysqli_query(connection, sql);
}
}
Why I can't just "+" the strings together?