this的用法 - 写c++时,用this指针指向字符串时报错
大家讲道理
大家讲道理 2017-04-17 11:48:43
0
1
278
    #include<iostream>
class father
{
public:
    char* name[16];
    int money;
    father(char* name,int money);
};
father::father(char*name,int money)
{
    this->name=name;
    this->money=money;
}

在vs2012中编写,倒数第二行指向name的的this下有红色浪线提示说“表达式必须是可修改的左值”,请问为什么不能这么写

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!