Const correctness: const char const * const GetName const (//stuff);
问题 Labelled as homework because this was a question on a midterm I wrote that I don't understand the answer to. I was asked to explain the purpose of each const in the following statement: const char const * const GetName() const { return m_name; }; So, what is the explanation for each of these consts? 回答1: Take them from the right. The one before the ; tells the client this is a design level const i.e. it does not alter the state of the object. (Think of this as a read-only method.) Okay, now