填空题
下面程序编译时发现ma[3]=9错误,其原因是 【11】 。
# include<iostream. h>
class FunArray
{
int *pa; //指向一个数组空间
int size; //数组元素个数
public:
FunArray(int a[ ], int thesize): pa(A) , size(thesize) { }
int Size( ){return size;}
}
};
void main( )
{
int s[ ]={3,7,2,1,5,4};
FunArray ma (s, sizeof (s)/sizeof(int) );
ma[3] = 9
cout<<ma[3]<<end1;
}
【参考答案】
没有重载[]运算符