My base ship .h looks like this:
#pragma once
#include <stdlib.h>
class BaseShip
{
protected:
public:
BaseShip(void);
~BaseShip(void);
int speed;
//getters
int GetSpeed();
//setters
void SetSpeed(int speed);
};
the .cpp
#include "BaseShip.h"
#include <stdlib.h>
BaseShip::BaseShip(void)
{
}
BaseShip::~BaseShip(void)
{
}
void BaseShip::SetSpeed(int speed)
{
this->speed = speed;
}
int BaseShip::GetSpeed()
{
return speed;
}
Now in the class I'm trying to access it I add in the include to the baseship.h file in the required classes.h. Then I create a pointer like:
BaseShip *ship;
The only problem is, when I try to use ship in the class I don't get access to my set or get methods (only need it to return/display a number). All I get is the ~BaseShip.
Can anyone see what it is I'm doing wrong?