A. MyData(MyArray<int>& x, MyArray<int>& y); should be
MyData(const MyArray<int>& x, const MyArray<int>& y);
B. MyArray& operator=(MyArray& copy); should be
const MyArray& operator=(const MyArray& copy);
C. void make_changes(MyData* edit); should be
void make_changes(const MyData* edit);
D. MyArray(MyArray& copy); should be
MyArray(const MyArray& copy);
E. const MyArray& operator=(const MyArray& copy); should be
const MyArray& operator=(const MyArray& copy) const;
A
其他有几个也对 但是没有解决main中的编译错误
更多推荐
Question 17: Which of the following identify const-correctness failures in the C
发布评论