转载于:https://www.cnblogs.com/hongjiumu/p/3550819.html
error C2556: 'const char &MyString::operator [](int)' : overloaded function differs only by return t...
最新推荐文章于 2021-05-18 15:03:28 发布
转载于:https://www.cnblogs.com/hongjiumu/p/3550819.html
const char & operator[](int i);/*const char & operator(int i);*/
编译出错:
error C2556: 'const char &MyString::operator [](int)' : overloaded function differs only by return type from 'char &MyString::operator [](int)'
修改:
char & operator[](int i);
const char & operator[](int i) const;/*const char & operator(int i);*/
就可以了。