摘要: ● Meaning “many forms”, polymorphism in OO terminology means a single statement in codethat might do different things depending on the context in which it isexecuted. ○ In thiscase, rpt[i]->Display() is a polymorphic call (when Display() is a virtual function). ○ Dependingon what kind of object w 阅读全文
posted @ 2011-06-28 12:15 Mayus 阅读(226) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 #define DEBUGBUILD 0 6 #define DEBUG if (DEBUGBUILD) cout 7 8 class Date { 9 private: 10 int day; 11 int month; 12 int year; 13 public: 14 Date() { DEBUG << "Date: default ctor" << endl; } 15 Date( 阅读全文
posted @ 2011-06-28 12:08 Mayus 阅读(198) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 #define DEBUGBUILD 0 6 #define DEBUG if (DEBUGBUILD) cout 7 8 class Date{ 9 private: 10 int day, month, year; 11 public: 12 Date(){ DEBUG << "Date: default ctor" << endl;} 13 Date(int m, int d, int 阅读全文
posted @ 2011-06-28 10:15 Mayus 阅读(235) 评论(0) 推荐(0)
摘要: 2011@US 阅读全文
posted @ 2011-06-28 10:04 Mayus 阅读(129) 评论(0) 推荐(0)