摘要: #include <stdio.h>template <class T, class M>class Base { public: T x; T y; M a; M b; public: T max() { return (x>y) ? (x):(y); } M min() { return (a< 阅读全文
posted @ 2017-04-25 12:31 roadmap 阅读(98) 评论(0) 推荐(0)
摘要: #include <stdio.h>template <class T>void swap(T a, T b){ int x = *a; *a = *b; *b = x;}template <class M>void sort(M arr, int len){ int i = 0; int j = 阅读全文
posted @ 2017-04-25 12:30 roadmap 阅读(173) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base{ int x; Base() { x = 100; } void func1() { printf("Base func1()\n"); } virtual void func2() { printf("Base virtual func2 阅读全文
posted @ 2017-04-24 17:31 roadmap 阅读(714) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base1{ virtual void func1() { printf("Base1 func1()\n"); } virtual void func2() { printf("Base1 func2()\n"); }};struct Base2: 阅读全文
posted @ 2017-04-24 17:03 roadmap 阅读(116) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base1{ virtual void func1() { printf("Base1 func1()\n"); } virtual void func2() { printf("Base1 func2()\n"); }};struct Base2: 阅读全文
posted @ 2017-04-24 16:58 roadmap 阅读(188) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base1{ virtual void func1() { printf("Base1 func1()\n"); } virtual void func2() { printf("Base1 func2()\n"); }};struct Base2: 阅读全文
posted @ 2017-04-24 16:57 roadmap 阅读(243) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base1{ virtual void func1() { printf("Base1 func1()\n"); } virtual void func2() { printf("Base1 func2()\n"); }};struct Base2: 阅读全文
posted @ 2017-04-24 16:51 roadmap 阅读(198) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base1{ virtual void func1() { printf("Base1 func1()\n"); } virtual void func2() { printf("Base1 func2()\n"); }};struct Base2{ 阅读全文
posted @ 2017-04-24 16:49 roadmap 阅读(210) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base1{ virtual void func1() { printf("Base1 func1()\n"); } virtual void func2() { printf("Base1 func2()\n"); }};struct Base2{ 阅读全文
posted @ 2017-04-24 16:32 roadmap 阅读(206) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct Base{ virtual void func1() { printf("Base func1()\n"); } virtual void func2() { printf("Base func2()\n"); } virtual void func 阅读全文
posted @ 2017-04-24 16:22 roadmap 阅读(168) 评论(0) 推荐(0)