上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 30 下一页
摘要: #include#include/*因为t1,t6是全局变量,t4,t5是在外部函数中局部变量,所以构造函数调用完之后就是析构函数t1,t6,t2,t3 t4,~t4,t5,~t5, ~t3,~t2,~t6... 阅读全文
posted @ 2015-11-07 19:12 cloudren2020 阅读(62) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/charley_yang/archive/2011/04/05/2005897.html一、嵌套类 在一个类的内部定义另一个类,我们称之为嵌套类(nested ... 阅读全文
posted @ 2015-11-07 19:09 cloudren2020 阅读(98) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;/*浅拷贝:只拷贝值,不拷贝空间,自动Test t1 (t2)*//*深拷贝:*/class Test{ int *m_p;public: ... 阅读全文
posted @ 2015-11-07 18:52 cloudren2020 阅读(118) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;class Test{ int m_data;public: Test(int i=0):m_data(i) { cout<<"Test(... 阅读全文
posted @ 2015-11-07 18:41 cloudren2020 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;/*甚时候必须must使用初始化列表1.初始化const数据成员2.初始化引用数据成员3.初始化对象4.初始化父类成员变量*/class Test{ con... 阅读全文
posted @ 2015-11-07 18:28 cloudren2020 阅读(91) 评论(0) 推荐(0) 编辑
摘要: /*实验内联函数的作用*1.实现c中宏的作用×2.多个cpp文件一个h文件关于一个函数的定义*/#includeusing namespace std;int inline g(int x=10){ return... 阅读全文
posted @ 2015-11-05 19:45 cloudren2020 阅读(78) 评论(0) 推荐(0) 编辑
摘要: /*对于一个字节(8bit)的无符号整形变量,求二进制表示中“1”的个数,要求算法执行效率尽可能地高。*/#include#includevoid test1(){ printf("请输入一个整数:"); int... 阅读全文
posted @ 2015-11-05 19:42 cloudren2020 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include#include/*实验转义字符在字符串中*/void test(){ char str[]="123\t5\0123\0abc"; printf("%ld\n",sizeof(str));//1... 阅读全文
posted @ 2015-11-05 19:40 cloudren2020 阅读(245) 评论(0) 推荐(0) 编辑
摘要: #include#include /*程序一般分为 Debug 版本和 Release 版本,Debug 版本用于内部调试,Release 版本发行给用户使用。断言 assert 是仅在 Debug 版本起作用的... 阅读全文
posted @ 2015-11-05 19:28 cloudren2020 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include#include#includevoid GetMem(char *p,int n){ p=(char*)malloc(n);//空间不得释放 内存泄露}char *GetMem2(char *... 阅读全文
posted @ 2015-11-05 19:25 cloudren2020 阅读(108) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 30 下一页