指针
文章平均质量分 77
weixin_42380877
这个作者很懒,什么都没留下…
展开
-
指针作为函数参数/指针类型的函数/指向函数的指针(function pointer)
指针作为函数参数:为什么需要指针做参数: 1. 需要数据双向传递时(引用也可以达到此效果) 2. 需要传递一组数据,只传首地址运行效率比较高example:#include <iostream> using namespace std; const int N = 6; void print(const in...原创 2018-07-06 18:29:10 · 2618 阅读 · 2 评论 -
对象指针/当前 this 指针
指向对象的指针,怎么调用对象里面的函数:指针名 -> 函数名;#include <iostream> using namespace std; class Point{ public: Point (int x =0, int y = 0):x(x), y(y){}; int Get_x(){ return x; }; int Get_y(){ ...原创 2018-07-06 18:51:15 · 183 阅读 · 0 评论