
C++面向对象与程序设计
十三苦心钻研
流年,向花好月圆夜;
芳华,寻温情乐态心。
展开
-
C++ 程序运行闪退解决方案
1.主函数中return 0;前加getchar();需要头文件<iostream>2.主函数return 0;前加system("pause");原创 2018-06-29 01:59:55 · 11146 阅读 · 0 评论 -
C++:Timer类实现
《C++菜鸟进化论》#include<iostream>#include<fstream>#include<cmath>using namespace std;class Timer{private: int minute; int second;public: Timer(int m = 0,int s = 0); Timer(c...原创 2018-06-29 01:50:54 · 5180 阅读 · 0 评论 -
C++ this指针
(菜鸟搬用工)1.this指针的用处:一个对象的this指针并不是对象本身的一部分,不会影响sizeof(对象)的结果。this作用域是在类内部,当在类的非静态成员函数中访问类的非静态成员的时候,编译器会自动将对象本身的地址作为一个隐含参数传递给函数。也就是说,即使你没有写上this指针,编译器在编译的时候也是加上this的,它作为非静态成员函数的隐含形参,对各成员的访问均通过this进行。2.t...转载 2018-06-29 01:29:28 · 266 阅读 · 0 评论