You declare b1 to be of type base*, but you don't assign it a value; it's uninitialised. You then compare that value with some other pointer, p. That doesn't test anything.
not really. you are just comparing the addresses where the pointer points to.
which is why in both cases b1 is pointing to some uninitialized value and it never passes the equality test so you'll always get to the else clause.
more importantly though, why do you want to compare?