我想通过类名来比较两个对象。第一个对象的类型为Card*,它指向一个MagicCard对象,第二个对象的类型为MagicCard - Card的子类。当我将它们与typeid进行比较时,它不起作用: if (typeid(*(this->cards[index])) != typeid(card)) {
//the first object is of type Card* inside a vector and points to aretur
either base Window object or derived Window objects like //Window_Derived.if(strcmp(windowName, typeid(Window).name()) == 0) // ...else if(strcmp(windowName, typeid(Window_Derived).name()) == 0)