converter - C++ checking an int or char and returning a text -


i wondering if there specific function checking if input int or character.

and returning answer, "this integer" or "this character".

if there not specific function converting, how should go doing it?

thanks in advance!!

you can use isdigit function check whether character entered integer or not checks digit 0 1 2 3 4 5 6 7 8 9 like:

#include<iostream> using namespace std;  int main(){     char inp;     cin>>inp;     if(isdigit(inp))         cout<<"integer";     else         cout<<"character";     return 0; } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -