I need to make a bool that will return true if (1 + (rand() % 101)) <= 50 , otherwise return false .
I want to make it so that if bool == true , then execute the function, if not, do not.
Through if (mybool == true) did not work.
I need to make a bool that will return true if (1 + (rand() % 101)) <= 50 , otherwise return false .
I want to make it so that if bool == true , then execute the function, if not, do not.
Through if (mybool == true) did not work.
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
But what's the problem?
if ((1 + (rand() % 101)) <= 50) call_function(); Source: https://ru.stackoverflow.com/questions/830113/
All Articles