The compiler explains it.
A string literal (anything in quotes) has a type of const char[num_characters].
Your code attempts to use the "&" operator on them, which is not valid.
Now, if you were to explicitly make one of them a String:
int main(){ String test = "test" String str = test & "something"; // or String str = String("test") & "something";}
Quote:
That's why I'm using & instead of +.
What does String::operator+() do then?
Finally, operator char *() is dangerous. At the very least make it const, but consider not using such an implicit operator anyway. They can lead to confusing errors where the compiler doesn't do what you expect. It is not without reason that the standard c++ string uses a member function called c_str() over an implicit c-string operator.