Loading

c++ typeid

简单使用

#include<iostream>
#include<string>
#include<new>
#include<typeinfo>
using namespace std;

class Character
{

};

int main(void)
{
    Character* pCh = new Character();
    cout << "typeid(Character) == typeid(*pCh): " << (typeid(Character) == typeid(*pCh));
    cin.get();
    return 0;
}

输出

 

posted @ 2018-08-24 09:44  注销111  阅读(136)  评论(0编辑  收藏  举报