C++ this指针的使用
来源:互联网 发布:知乎神经性耳鸣5年 编辑:程序博客网 时间:2024/04/30 02:52
//=====================================================//
#include <iostream>
#include <cstdio>using namespace std;
class Complex
{
public:
double real,imag;
void Print()
{
cout<<real<<","<<imag<<endl;
}
Complex(double r,double i):real(r),imag(i){}
Complex Addone()
{
this->real++;
this->Print();
return *this;
}
};
int main()
{
Complex c1(1,1),c2(0,0);
c2=c1.Addone();
return 0;
}
//==========================================================//
#include <iostream>
#include <cstdio>
using namespace std;
class A
{
int i;
public:
void Hello()
{
cout<<"Hello"<<endl;
}
};
int main()
{
A *p;
p->Hello();
}
//===================================================================//
0 0
- 【c++】this指针的使用
- C ++的this指针
- this指针的使用
- this指针的使用
- this 指针的使用
- this指针的使用
- 第二十章,对象指针及this的使用(C++)
- C++this指针的理解
- C++this指针的理解
- C++this指针的用法
- 【C++】隐含的this指针
- C++ this指针的使用
- Java this指针的使用
- this指针的使用js
- 【C/C++】this指针
- C++this指针的理解和用法
- C++this指针的理解和用法
- 【C++】:C++之this指针的作用
- 连连看算法分析
- Linux操作系统中的系统调用接口函数
- PHP 的__call()
- 用 logcat 命令来查看 android 系统日志缓冲区的内容
- 输入框 UITextField 基本属性
- C++ this指针的使用
- .net的基于mysql的DBhelper实现
- SVN检出的MAVEN项目转换为web项目
- hdu 1010
- 站在巨人的肩膀上学习Android开发
- PHP函数:var_export()
- 黑马程序员——————————面向对象4
- JSP中使用JavaScript动态插入删除输入框
- 黑马程序员—IO流(字符流)