I was reading on errors, where it said that it's common to use concatenation of strings to describe a process, example:
void error(string s1, string s2)
{
throw runtime_error(s1+s2);
}
This led me to play around with just adding strings together, where I found an error in my code and discovered pointers:
int main()
{
string func = "function";
string mesg = "Testing" + " new" + func;
cout << mesg;
}
I looked up the error and a few sources said that "Testing" + " new" was being seen as char* + char* which can't just be added together. My main question is, why doesn't it come off as string* + string*? A minor question I had also, is about the error() function. Why bother to concatenate the strings at all when you can just make a singular string?