首页 > 编程语言 > 详细

c语言之获取变量的类型

时间:2020-01-01 16:13:34      阅读:296      评论:0      收藏:0      [点我收藏+]
#include<typeinfo>
using std::cout;
int main()
{
    int i;
    cout << typeid(i).name();
    //输出结果为int
    return 0;
}

需要引入头文件:#include<typeinfo>

c语言之获取变量的类型

原文:https://www.cnblogs.com/xiximayou/p/12128942.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!