Abstract klasse, polymorfi
Hvad er forkert her?? jeg kan ikke lave enobjects=new CWall('*');
fejlmeldning er
'type cast' : conversion from 'CWall *' to 'ICBoardObjects *' exists, but is inaccessible
ICBoardObjects er en abstract klasse med en pure virtual funktion.
------------------------------------------------------------------
class ICBoardObjects{
public:
char obstracle;
virtual char getObstracle()=0;
};
------------------------------------------------------------------
#include "CWall.h"
class CGameBoard{
private:
ICBoardObjects* objects;
int x;
int y;
public:
CGameBoard();
void makeMatrix();
};
CGameBoard::CGameBoard(){
objects=new CWall('*');
}