So I have this simple function and it is suppose to return true or false. True is only returned 2% of the time and false every other time. However, whenever I try to compile the full code I get the error message;
'TRUE' was not declared in this scope C++
I am aware I can use int
instead of bool
and just use 1
for true and 0
for false, but I want to figure out why this won't work. Any help?
Here is my function:
bool Bunny::determineMutant()
{
int rand_num = rand() % 100 + 1; //random num 1-100
if(rand_num == 1 || rand_num == 2) return TRUE;
else return FALSE;
}