here is the class definition (it's for exception handling):
class MyException {
public:
MyException(const char * pTxt) : pReason(pTxt){};
const char * pReason;
};
And later it is used as follows:
throw MyException("file too short");
after throw, is a new object created and initialized? Whatever the case, I don't understand how the class definition allows it to be initialized with a text string. It takes a pointer to a text string, doesn't it? And then sets pReason to that pointer, right? And how does this involve the line const char * pReason? I am confused, can anyone at least explain the class definition to me? I might be just looking past something obvious. I have copied the above code from "c++ for game programmers" page 90, btw.