小编ati*_*ngh的帖子

如何在C++中检查变量的输入数据类型?

我对如何在C++中检查输入变量的数据类型有一个疑问.

#include<iostream>
using namespace std;
int main()
{
    double a,b;
    cout<<"Enter two double values";
    cin>>a>>b;
    if()        //if condition false then
        cout<<"data entered is not of double type"; 
        //I'm having trouble for identifying whether data
        //is double or not how to check please help me 
}
Run Code Online (Sandbox Code Playgroud)

c++

4
推荐指数
1
解决办法
6550
查看次数

标签 统计

c++ ×1