[ create a new paste ] login | about

Link: http://codepad.org/Q21fhVP1    [ raw code | fork ]

C++, pasted on Jun 3:
struct ShapeInterface
{
 virtual void Draw()=0;
 virtual void SetName(char* name)=0;
 virtual char* GetName()=0;
};
struct CircleInterface:public virtual ShapeInterface
{
  virtual void SetRadius(double radius)=0;  
};
class ShapeImpl:public virtual ShapeInterface
{
  virtual void SetName(char* name){/*save it somewhere*/}
  virtual char* GetName(){/*return it*/ return NULL;}
};
class CircleImpl:public CircleInterface,public ShapeImpl
{
 virtual void Draw(){/*draw a circle*/}
 virtual void SetRadius(double radius){/*set the radius*/}
};

int main()
{
 CircleImpl circle;
 return 0;
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: