If statement reading boolean value

Hi all,

I have a function that evaluates to true or false, and seems to work great, but I'm having a problem using it with an if statement.

How can I write an if/else statement that evaluates whether the function returned a true or false value?

It seems like this should be really straightforward... Am I having trouble finding an answer because it's such a specific situation?

Thanks for your help.
1
2
3
4
5
6
7
8
if ( MyFunction( /* some arguments */ ) )
{
// do something
}
else
{
// do other
}
When you put MyFunction in an if, do you include the data type in the (arguments), or just the variable name?
When you call a function you shall pass arguments to it if it has parameters.
Ok, got it.

Thank you!
Topic archived. No new replies allowed.