
C++输出某个数据的类型
3个回答
展开全部
完全可以:
#include <iostream>
using namespace std;
void main()
{
int a=0;
cout<<typeid(a).name()<<endl;
}
#include <iostream>
using namespace std;
void main()
{
int a=0;
cout<<typeid(a).name()<<endl;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?

2023-08-15 广告
通常情况下,我们会按照结构模型把系统产生的数据分为三种类型:结构化数据、半结构化数据和非结构化数据。结构化数据,即行数据,是存储在数据库里,可以用二维表结构来逻辑表达实现的数据。最常见的就是数字数据和文本数据,它们可以某种标准格式存在于文件...
点击进入详情页
本回答由光点科技提供
展开全部
头文件用了typeinfo,函数typeid(Expression).name()返回Expression的数据类型,看看下面这段示例:
#include <iostream>
#include <typeinfo>
using namespace std;
int main()
{
int a = 0;
cout << typeid(a).name() << endl;
return 0;
}
#include <iostream>
#include <typeinfo>
using namespace std;
int main()
{
int a = 0;
cout << typeid(a).name() << endl;
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
#include <iostream>
#include <typeinfo>
using namespace std;
int main()
{
int a;
float b;
cout<<typeid(a).name()<<' '<<typeid(b).name();
return 0;
}
#include <typeinfo>
using namespace std;
int main()
{
int a;
float b;
cout<<typeid(a).name()<<' '<<typeid(b).name();
return 0;
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询