C++left operand must be l-value
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/06/16 18:38:24
C++left operand must be l-value
#include
class CA
{
public:
double *p;
int n;
public:
CA(int n1)
{n=n1;p=new double[n];}
~CA()
{delete []p;}
CA(CA &t)
{n=t.n;p=t.p;}
double operator[](int i)
{return p[i];}
};
void main()
{
CA t(5);
double sum=0,d;
for(int i=0;i>d;
t[i]=d;
sum+=t[i];
}
CA s(t);
cout
#include
class CA
{
public:
double *p;
int n;
public:
CA(int n1)
{n=n1;p=new double[n];}
~CA()
{delete []p;}
CA(CA &t)
{n=t.n;p=t.p;}
double operator[](int i)
{return p[i];}
};
void main()
{
CA t(5);
double sum=0,d;
for(int i=0;i>d;
t[i]=d;
sum+=t[i];
}
CA s(t);
cout
operator[]返回的是一个临时变量
改:
double& operator[](int i)
{
return p[i];
}
改:
double& operator[](int i)
{
return p[i];
}
left operand must be l-value(在线等待)
left operand must be l-value什么意思
left operand must be l-value(在线等)
这个C编译错误提示什么意思.lvalue required as left operand of assignment
the L/C must be opened before August 26th.
must return a value
信用证的附加条款+MUST BE IN STRICT CONFORMITY WITH THE L/C TERMS AT
I always believe that never left ,it must be you!
i always believe that never left it must be you
Multiple left-hand sides must be separated by commas.
We must be l------- to the school
Your advice must be of great value and worth taking,worth前面为