This is simplified version of my code:
struct InvalidConfigurationException : public exception {
InvalidConfigurationException(){}
const char* what() const throw() {
return "hi";
}
};
this returns "hi".
But then if I change this it doesn´t work:
struct InvalidConfigurationException : public exception {
InvalidConfigurationException(){}
const char* what() const throw() {
string hello = "hi";
return hello.c_str();
}
};
OUTPUT = Ól< (this is what I get)
This is simplified, but I basically need to return a concatenated string, that´s why I need the c_str(). Can anyone help me?