C++ typeid关键字详解

typeid关键字 注意:typeid是操做符,不是函数。这点与sizeof相似)html 运行时获知变量类型名称,能够使用 typeid(变量).name()web 须要注意不是全部编译器都输出”int”、”float”等之类的名称,对于这类的编译器能够这样使用安全 int ia = 3; if(typeid(ia) == typeid(int)) { cout <<"int" <<en
相关文章
相关标签/搜索