|
-
February 12th, 2003, 02:00 AM
#1
Abstract Class problem
CMy is a abstract class. As per abstract class definition we can not make any instance of that. But it is not giving any error in MSDEV IDE.
#include <iostream.h>
class CMy
{
public:
CMy(){}
CMy(int i)
{
this->i=i;
};
~CMy()
{
};
virtual void show() const =0;
int i;
};
void show(CMy &myObject)
{
myObject.i = 7;
}
void main(int argc, char* argv[])
{
CMy(9);
show(CMy(6));
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|