【发布时间】:2014-12-14 13:55:49
【问题描述】:
我是 C++ 新手,因为这个问题我很抱歉,但这是一场斗争。如果有人可以帮助我区分以下几行,我将不胜感激。
char& operator [](int); // write (why with reference?)
char operator [](int) const; //read (why without a reference?)
char const &operator[](int) const; // what is the difference compared to the previous line?
const char *& operator[] (const int* ); // is this also possible?
【问题讨论】:
标签: c++ pointers reference operator-overloading