摘要: cout << sizeof(variable); 输出结果为变量所占用的 字节数量。 sizeof() 函数不需要头文件 阅读全文
posted @ 2020-05-10 21:02 zeroPatrick 阅读(4443) 评论(0) 推荐(0)
摘要: 首先引入头文件: <typeinfo> 获取变量类型的语句是:typeid(variable).name(),其中 “variable”是你定义的变量名称。 #include <iostream> #include <typeinfo> using namespace std; int main() 阅读全文
posted @ 2020-05-10 20:34 zeroPatrick 阅读(23176) 评论(0) 推荐(6)