上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 112 下一页
摘要: #include <iostream> template<class typeName, class typeAge = int> class Person { public: Person(typeName name, typeAge age): name(name), age(age) {} v 阅读全文
posted @ 2022-07-17 23:14 thomas_blog 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> template<class typeName, class typeAge> class Person { public: Person(typeName name, typeAge age): name(name), age(age) {} void sh 阅读全文
posted @ 2022-07-17 23:11 thomas_blog 阅读(12) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> template<class typeName, class typeAge> class Person { public: Person(typeName name, typeAge age): name(name), age(age) {} void sh 阅读全文
posted @ 2022-07-15 14:00 thomas_blog 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> template<class T> bool compare(T &a, T &b) { return (a == b); } class Person { public: Person(std::string name, int age): name(nam 阅读全文
posted @ 2022-07-13 14:30 thomas_blog 阅读(17) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> /* 函数模板和普通函数都实现 优先调用普通函数 */ void myswap(int &a, int &b) { std::cout << "myswap" << std::endl; int tmp = a; a = b; b = tmp; } templ 阅读全文
posted @ 2022-07-13 13:31 thomas_blog 阅读(95) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> template<typename T> void myswap(T &a, T &b) { T tmp = a; a = b; b = tmp; } int main() { using namespace std; int a = 1; int b = 2 阅读全文
posted @ 2022-07-13 12:44 thomas_blog 阅读(32) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <fstream> int main() { using namespace std; ifstream ifs; ifs.open("test.txt", ios::in); if(!ifs.is_open()) { cout << "op 阅读全文
posted @ 2022-07-12 16:58 thomas_blog 阅读(19) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <fstream> int main() { using namespace std; ofstream ofs; ofs.open("test.txt", ios::out); ofs << "hello furong" << endl; 阅读全文
posted @ 2022-07-12 15:11 thomas_blog 阅读(22) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> class Person { public: Person() { std::cout << "Person" << std::endl; } virtual ~Person() = 0; public: }; Person::~Person() { std: 阅读全文
posted @ 2022-07-11 15:46 thomas_blog 阅读(103) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> class Person { public: Person() { std::cout << "Person" << std::endl; } ~Person() { std::cout << "~Person" << std::endl; } public: 阅读全文
posted @ 2022-07-11 14:59 thomas_blog 阅读(20) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 112 下一页