I have something like this:
class A
{
public:
A();
~A();
};
class B : public A
{
//stuff
};
class C : public A
{
//stuff
};
class D : public A
{
//stuff
};
void Collision()
{
//obj is a multidimensional array of class A that stores objects from class B, C and D
if(obj[x][y] != B && obj[x][y] != C) //type name is not allowed
doStuff();
}
I'm getting the error: type name is not allowed
I know it is not suposed to compare the objects like this, but i dont know how i should do it.