📄 rtti.cpp
字号:
#include <typeinfo>
class Dog {
public:
Dog() { }
virtual void fetch() = 0;
};
class Dalmation : public Dog {
public:
Dalmation() { }
virtual void fetch();
};
void Dalmation::fetch()
{
}
int main()
{
Dalmation z;
Dog* y = &z;
if (typeid(*y) == typeid(Dalmation))
{
return 0;
}
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -