摘要:        
1、先看下一个类Test.h 1 #define PI 3.14159 2 const int NUM = 3;//定义常量 3 class Test 4 { 5 public: 6 Test(); 7 virtual ~Test(); 8 virtual void action(const int input);//保护,防止意外修改 9 int getstate() const;10 const MyClass istate();11 private:12 static int mLay;13 ...    阅读全文
        
            posted @ 2012-08-16 11:39
lovemu
阅读(1379)
评论(0)
推荐(0)
        
            
        
        
摘要:        
1、Test.h 1 class Test 2 { 3 public: 4 Test(); 5 virtual ~Test(); 6 virtual void action(); 7 static virtual void go(); 8 private: 9 static int mLay;10 int mOut;11 12 };此处,static 与 virtual不能共用,此时这里去掉virtual关键字。2、Test.h 1 class Test 2 { 3 public: 4 Test(...    阅读全文
        
            posted @ 2012-08-16 10:00
lovemu
阅读(351)
评论(0)
推荐(0)
        
 
                    
                     
                    
                 
                    
                 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号