fig09_23.cpp

来源:互联网 发布:热敏标签打印机软件 编辑:程序博客网 时间:2024/06/16 16:10

fig09_23.cpp

#include<iostream>using namespace std;class Test{public:explicit Test(int = 0);void print() const;private:int x;};Test::Test(int value):x(value){}void Test::print() const{cout << "    x = " << x;cout << "\n  this->x = " << this->x;cout << "\n(*this).x = " << (*this).x << endl;}int main(){Test testObject(12);testObject.print();}


原创粉丝点击