Why is const required [C++] ? [closed]
- by Andy Leman
Possible Duplicate:
What's the difference between a const member function and a non-const member function?
class Message
{
public:
Message(const char* pStr, const char* key);
Message(const char* pStr);
Message();
void encryptMessage();
void decryptMessage();
const char* getUnMessage() const;
const char* getEnMessage() const;
void getMessage();
void getKey();
~Message();
private:
char* pUnMessage;
char* pEnMessage;
char* pKey;
};
In this program, why using const? (2 different places) Please explain those 2 for me.
Thank you very much!