Hey guys,
I have an Event class, which is composed of a LandMine class, which is derived from an abstract class called Weapon ...
error C2259: 'LandMine' : cannot instantiate abstract class
class Event
{
private:
string warning;
int warningCount;
public:
void displayWarning();
LandMine EventTime;
};
class Weapon
{
protected:
int damage;
int ammoRemaining;
public:
virtual int attack(int, int) = 0; // damage, ammoRemaining,
virtual int reload(int) = 0; // USER_ammoAmount
virtual void dropAmmo(int) = 0; //USER_ammoAmount
};
class LandMine : public Weapon
{
private:
int size;
public:
int attack(int); // OVERLOADED - Players remaining health
void disarm();
LandMine();
~LandMine();
};
I just can't figure out why on earth this error is coming up. I've put virtual infront of the LandMine constructor too with no go.
Ideas? Thanks
Using VSC++ express sp1 64bit.
EDIT: Source - http://rafb.net/p/dOAhCF93.html
[Edited by - 3shirtlessmen on October 11, 2008 6:11:12 PM]