I am looking for a function that returns what a value is...if it's a digit or a char.
Basically, here's what I'm trying to do:
// class outline
class mb
{
public: mb( int i );
mb( char c );
int getNum();
char getCh();
bool isNum();
private: int num;
char ch;
bool isAnum;
};
Basically, I will create a new mb and assign a value. For ex in main:
mb *p1 = new mb(23);
mb *p2 = new mb('x');
// now when retrieving value to use somewhere else, i will use
// the bool ftn to tell me wether it's an int or not.
bool b = p2 -> isNum();
//etc.
but, isdigit doesn't work for this. at least when i tried it with a very simple test program it didn't work.
any ideas?
any help would be greatly appreciated