ISO C++ forbids cast to non-reference type used as

int main(){
char arra[] = "abcd";
    char *ch =arra;
while((*ch++ = *arra++) != '\0' )
    {            
            cout<<*ch;     
    }

}

为什么不能non-reference类型作为左值,这里不太理解,哪位大侠能解释下。。。。。。。。

你可能感兴趣的:(C++,c,C#)