上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页
摘要: 护眼背景色 : 199 237 204 阅读全文
posted @ 2019-03-20 15:17 唯一诺 阅读(338) 评论(0) 推荐(0)
摘要: 转载:https://blog.csdn.net/vanturman/article/details/80269081 近日,看到这样一行代码: typedef typename __type_traits<T>::has_trivial_destructor trivial_destructor; 阅读全文
posted @ 2019-03-15 18:47 唯一诺 阅读(15462) 评论(1) 推荐(5)
摘要: https://blog.csdn.net/luoyayun361/article/details/80428882 #include <iostream> using namespace std; void * func(int a) //指针函数,实质是一个函数,返回值是指针类型; { stat 阅读全文
posted @ 2019-03-14 11:13 唯一诺 阅读(177) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/eleclsc/p/5918114.html 阅读全文
posted @ 2019-03-13 15:03 唯一诺 阅读(149) 评论(0) 推荐(0)
摘要: 当多个数据需要共享内存或者多个数据每次只取其一时,可以利用联合体(union)。在C Programming Language 一书中对于联合体是这么描述的: 1)联合体是一个结构; 2)它的所有成员相对于基地址的偏移量都为0; 3)此结构空间要大到足够容纳最"宽"的成员; 4)其对齐方式要适合其中 阅读全文
posted @ 2018-09-21 10:57 唯一诺 阅读(5715) 评论(0) 推荐(2)
摘要: #define _CRT_SECURE_NO_WARNINGS #include #include #include using namespace std; int main(int argc, char * argv[]) { //string str2 = "xiaoliang"; //string str3("xiaohei", 5); //... 阅读全文
posted @ 2018-09-19 22:40 唯一诺 阅读(197) 评论(0) 推荐(0)
摘要: #define _CRT_SECURE_NO_WARNINGS #include #include using namespace std; int main(int argc, char * argv[]) { list lst; lst.push_back(10); //从链表尾部添加 lst.push_front(20); //从链表头部添加 ... 阅读全文
posted @ 2018-09-19 21:55 唯一诺 阅读(193) 评论(0) 推荐(0)
摘要: 1.类中重载+操作符 #define _CRT_SECURE_NO_WARNINGS #include <iostream> using namespace std; class Object { public: Object() { } Object(int a) { num = a; } Obj 阅读全文
posted @ 2018-09-16 21:20 唯一诺 阅读(362) 评论(0) 推荐(0)
摘要: 一、在以下几种情况下会调用对象的拷贝构造函数(对象被创建时): 1.一个对象以值传递的方式作为函数的形参时; void func(CTest t) // CTest为clas类型,见下文 { cout << t.a << " " << t.b << endl; } 2.一个对象以值传递的方式作为函数 阅读全文
posted @ 2018-09-16 18:36 唯一诺 阅读(1220) 评论(0) 推荐(0)
摘要: 1.友元函数的一般形式: friend <返回类型> <函数名>(<参数列表>); #include <iostream> using namespace std; class Test { friend class Object; //友元类 friend void g_func(); //友元函 阅读全文
posted @ 2018-09-14 20:19 唯一诺 阅读(1127) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页