pointers are strongly typed; you cannot just say
double * dp = &x; //no can do.
you can force the issue with casting, but all bets are off on how you access the data without going out of bounds in memory. The most common use of that is to cast to 1 byte types to handle the data byte-wise, which is sometimes useful for things like compression or writing to a binary file.
consider this as well:
if you cast a pointer of one to two or two to one, you can access the first two items correctly because they are identical, and the third items and beyond are not safe to access.
if you have a situation like that, just cast the pointer, but you need to be sure you know what you are doing. This kind of coding is more C-ish and it is very rare in C++ to need to resort to this kind of thing.
anyway, you can force it with a cast. What happens after that is up to you!
@jonnin I understand but in my code the "Cards" class is the base class for all other classes, so what I don't understand is why the pointer is being initialized as "Cards*" without inheriting anything ?
Can you explain? or Do I have the inheritance thing all wrong lol
You can 'go up' from derived towards the base (upcast) but can't 'come down' away from the base (downcast) without using a cast.
If Cards is the base class and from the first post DamageCreature is Cards* and Creature is derived from Cards then you can't assign a type Cards* to Creature*. As keskiverto says above, you need to use a dynamic_cast.