适合初学者学习以及程序员回顾

源代码在线查看: v-destructor.cpp

软件大小: 15298 K
上传用户: jjkk778
关键词: 初学者 程序员
下载地址: 免注册下载 普通下载 VIP

相关代码

				// V-Destructor.cpp
				
				#include 
				using std::cin;
				using std::cout;
				using std::endl;
				
				//---- 宣告类别 Shape --------
				class Shape
				{
				private:
				  int i;
				public:
				  Shape(): i(7)  
				   {cout 				  virtual ~Shape()
				   {cout 				  virtual void Rotate()   
				   {cout 				  virtual void Erase()  
				   {cout 				};
				
				//---- 宣告类别 Circle--------
				class Circle : public Shape
				{
				private:
				  int r;
				public:
				  Circle(): r(5)      
				    {cout 				  Circle(int N): r(N) 
				    {cout 				  ~Circle()           
				    {cout 				  void Rotate()  {cout				  void Erase()   {cout				};
				
				//---- 宣告类别 Cylinder--------
				class Cylinder : public Circle
				{
				private:
				  int r, h;
				public:
				  Cylinder(): r(5), h(1)    
				     {cout 				  Cylinder(int M, int N): r(M), h(N)
				     {cout 				  ~Cylinder()         
				     {cout 				  void Rotate(){cout				  void Erase() {cout				};
				
				// ----主程式---------------------------
				main()
				{
				  cout 				  Shape *pS1 = new Circle;
				  cout 				  Shape *pS2 = new Cylinder;
				  cout 				  delete pS1;
				  cout 				  delete pS2;
				}
								

相关资源