Witam.
Mam obiekt o nazwie Bullet o następującej konstrukcji:
class Bullet
{
public:
char letter;
int clock;
int speed;
int posX, posY;
int moveDir;
Bullet(char a, int b, int c, int d, int e, int f)
{
letter = a;
clock = b;
speed = c;
posX = d;
posY = e;
moveDir = f;
}
~Bullet();
};
Jak teraz usunąć ten obiekt aby zwolnić pamięć?
delete bullets[x];
Powyższy przykład gdzie bullets[x] to wskaźnik do klasy nie działa, zwracając błąd:
[Linker error] undefined reference to `Bullet::~Bullet()'