this的用法 - 写c++时,用this指针指向字符串时报错
大家讲道理
大家讲道理 2017-04-17 11:48:43
0
1
296
    #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下有红色浪线提示说“表达式必须是可修改的左值”,请问为什么不能这么写

大家讲道理
大家讲道理

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

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!