this指针
来源:互联网 发布:数据挖掘所需要的技术 编辑:程序博客网 时间:2024/05/29 07:29
在类的非静态成员函数中访问类的非静态成员时,编译器会自动将对象地址作为一个隐含参数传递给函数
date.Setmonth(9);
自动转为为
Setmonth(&data, 9);
this指针使用:
1.在类的非静态成员函数中返回类对象本身时,直接使用return *this;
2.当参数与成员变量名相同时用来区分二者,如this->n = n;
0 0
- this指针
- this指针
- this指针
- this指针
- this指针
- this 指针
- this指针
- this指针----
- this指针
- this 指针
- This 指针
- this指针
- This指针
- this指针
- this指针
- this 指针
- this指针
- this指针
- android SharedPreferences工具类
- 【Web测试专栏】Selenium+JUnit自动化测试方案 (三)
- Segue --数据传递、顺传、逆传
- wireshark 抓本地包.
- 给梦想留点时间
- this指针
- gradle中的task(一)
- PHP四大基本排序算法实例
- OutOfMemoryError
- android MotionEvent中getX()和getRawX()的区别
- isKindOfClass(java的instanceof)
- 动态链接库简介
- 范式理论
- Aprior算法简化算法——FP-Tree思想与实现(转)