2016年6月13日

C++ 引用基础

摘要: //引用 #include using namespace std; struct Student{ char name[30]; int age; }; struct Teacher{ int &at2; int &bt2; }; int GetNum(Student &s2){ s2.age = 19; return s2.age; ... 阅读全文

posted @ 2016-06-13 23:13 寒魔影 阅读(249) 评论(0) 推荐(0)

C语言错误 指针的类型错误

摘要: //指针的类型错误 #include #include #include //用const来限制形参的指向不可以修改,优化代码的安全性 int Getnum(int ** const pin/*in*/){ return 1; } //指针的类型 //指针都是有自己的类型的 例如 int *,int ** //指针的类型本质上是对指针所指向的内存空间一种描述 //一级指针,二级指针只... 阅读全文

posted @ 2016-06-13 15:13 寒魔影 阅读(567) 评论(0) 推荐(0)

导航