First: (char*)fixtureAData == "PLATFORM"
compares 2 pointers, it does not compare 2 strings. You need to use strcmp
or strncmp
. This may work if your compiler uses string pooling and fixtureAData
is also assigned to the string literal "PLATFORM"
, but this isn't a good/safe assumption.
Second: If you are casting a derived class to one of its base classes (as I'm guessing you're doing, but it's not clear) and then calling a virtual function on that base class, it will indeed use the vtable to find the most derived function to call. Please clarify you're question if I'm making a false assumption about what you're doing.