Wed Jul 04, 2007 12:32 am
class Shape
{
public:
virtual void Draw() // virtual function for C++ virtual function example
{
cout <<"I am class Shape";
}
};
class Line : public Shape
{
public:
void Draw()
{
cout<<"I am line class - Overridden virtual function";
}
};
void main()
{
Shape *x, *y;
x = new Shape();
x->Draw();
y = new Line();
y->Draw();
}
I am class Shape
I am line class - Overridden virtual function
Wed Jan 23, 2013 11:50 pm
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.