if i want to check that wether the entered character is char type or int type,how can i do that?
nida afaq 0 Newbie Poster
Recommended Answers
Jump to PostThe entered character is always of a char type. Presumably what you want is to see if that char represents a digit:
#include <cctype> #include <iostream> int main() { char ch; while ( std::cin.get ( ch ) ) std::cout<< std::boolalpha << (bool)std::isdigit ( ch ) <<'\n'; }
Jump to PostThree duplicate threads merged.
All 6 Replies
nida afaq 0 Newbie Poster
Freaky_Chris 299 Master Poster
nida afaq 0 Newbie Poster
Freaky_Chris commented: 3* same thread! Unacceptable +0

iamthwee
Narue 5,707 Bad Cop Team Colleague
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.