标题:继承
关键词:this函数
内容:
A今日完成情况
关键词:this函数
内容:
A今日完成情况
1. this函数100%
B具体内容
this函数
#include<iostream>
using namespace std;
class Test
{
int x;
public:
Test(int=0);
void print();
};
Test::Test(int a){x=a;
}
void Test::print()
{
cout<<" x= "<<x<<endl;
cout<<"this->x= "<<this->x<<endl;
cout<<"(*this).x="<<(*this).x<<endl;
}
int main()
{
Test testObject(666);
testObject.print();
return 0;
}
C明日计划
A 人类设计
B 为什么需要继承