阅读背景:

为什么在成员函数中,类型char数组的类成员突然出现了类型const char数组?

来源:互联网 

I have the following code.

我有以下代码。

#include <exception>

public MyException : public std::exception {
private:
    const char* MESSAGE = "ExceptionReport";

protected:
    static const int MAX_MESSAGE_LENGTH = 200;
    char composedMessage[MyException::MAX_MESSAGE_LENGTH];

public:
    virtual const char* what() const throw() {
        strcpy(this->composedMessage, this->MESSAGE);
        return this->composedMessage,
    }
};
#include



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: