I need to check if a variable is a whole number, say I have the code:
double foobar = 3; //Pseudocode if (foobar == whole) cout << \"It\'s whole\";
Depends on your definition of whole number. If you consider only 0 and above as whole number then it's as simple as: bool whole = foobar >= 0;.
bool whole = foobar >= 0;