Odds or Even baby...
May 29, 2000 05:10 PM
The code looks great, and I''m planning on using a maximized version of this...
some errors in there
lemme fix your program
- pouya
--------------
The trick to flight is to throw yourself at the ground and miss!!!
Edit: sorry, the font size was TOO big the first time
Edited by - pouya on May 29, 2000 6:13:33 PM
lemme fix your program
class isEven
{
private:
int value;
public:
isEven(int num) : value(num) {}
operator bool() { return value&1; }
};
class isOdd
{
private:
int value;
public:
isOdd(int num) : value(num) {}
operator bool() { return !isEven(value); }
};
void main()
{
int x=...;
if (isEven(x))
// x is even
else
// x is odd
}
- pouya
--------------
The trick to flight is to throw yourself at the ground and miss!!!
Edit: sorry, the font size was TOO big the first time
Edited by - pouya on May 29, 2000 6:13:33 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement