标签:code char* div har 判断 nbsp class log height
typeid可用来判断类型是否相等:
例如有下面的定义:
char *str; int a = 2; int b = 10; float f;
类型比较 | 结果 | 类型比较 | 结果 |
---|---|---|---|
typeid(int) == typeid(int) | true | typeid(int) == typeid(char) | false |
typeid(char*) == typeid(char) | false | typeid(str) == typeid(char*) | true |
typeid(a) == typeid(int) | true | typeid(b) == typeid(int) | true |
typeid(a) == typeid(a) | true | typeid(a) == typeid(b) | true |
typeid(a) == typeid(f) | false | typeid(a/b) == typeid(int) | true |
标签:code char* div har 判断 nbsp class log height
原文地址:http://www.cnblogs.com/yongdaimi/p/7094190.html