![]() |
|
|
+ Search |
![]()
|
May 27th, 2003 02:36
Colin Thomsen, Lam Ho,
Assuming you have a character as the input, the function can be
something like:
#include <iostream>
void IsDigit(char c)
{
if ((c >= '0') && (c <= '9'))
std::cout << "Digit(" << c << ")"<< std::endl;
else
std::cout << "Not digit" << std::endl;
}
int main()
{
IsDigit('a');
IsDigit('3');
}