摘要: 纯属个人理解,在内存中实际存储情况可能不是如此的,我也没有去详细查询,只是这样便于理解。 ps:本来是我的个人笔记中的,感觉自己理解的挺好,就分享出来了。 阅读全文
posted @ 2020-07-03 21:59 Rainarose 阅读(205) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int& test_str() { int a = 1; return a; //通过返回 a 的地址来进行 值的返回(即 a的地址中所储存的值) } int ff(int t) //返回的就是个数 a 的值,a属于局部变量,函数调用完后内存自动释放,地址也就不存在 //所以运行 &ff(b) 会报错 ... 阅读全文
posted @ 2018-12-05 17:24 Rainarose 阅读(5967) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; class MyClass { public: int GetValue() const ; int GetValue() { return x + y; } int GetMax() { return x > y ? 阅读全文
posted @ 2018-11-26 21:34 Rainarose 阅读(1249) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; //拷贝构造函数的理解 class Point { public: Point(); Point(int X, int Y); ~Point(); Point(Point &p); void setPoint(int 阅读全文
posted @ 2018-11-25 18:41 Rainarose 阅读(412) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h" #include "stdlib.h" #define SIZE 4 struct student { int num; struct student *next; }stu[SIZE]; main() { struct student *h=NULL,*q,*tail; int i=0; while(inext=t... 阅读全文
posted @ 2018-06-29 10:20 Rainarose 阅读(173) 评论(0) 推荐(0) 编辑