C++学习
ren1204
这个作者很懒,什么都没留下…
展开
-
C++ 类指针问题, 类指针=0,能调用类内部成员函数
/*测试类指针*/#include <iostream>#include <stdlib.h>#include <stdio.h>#include <string.h>using namespace std;class CClassPointer{ public: CClassPointer();...原创 2019-10-23 10:02:07 · 861 阅读 · 0 评论 -
c++ 函数模版
如果需要多个将同一个算法用于不同类型的函数,请使用模版函数模版:要让编译器知道程序需要一个特定形式的交换函数,只需在程序中使用Swap()函数即可,编译器将检查所使用的参数类型,并生成相应的函数,1. template<typename AnyType>void Swap(AnyType &a, AnyType&b){ AnyType tem...原创 2019-10-14 18:07:30 · 94 阅读 · 0 评论