Original Post
I was just wondering which way everyone else uses return values in condition statements: Option 1: Option 2; I prefer option #1 because it makes it easier to debug and if I have multiple dependancies on a function return value, I can use func_retval multiple times. Does anyone know the different speeds of the two? What are the pro's and con's? I know one con is you have to have an int for every func you want to use the return value for (can be a little messy?) and a pro is why I said I use option #1 above [grin] Discuss... [Edited by - SAE Superman on February 24, 2005 11:53:37 AM]
int func_retval = func( x, y, z );
if( func_retval )
{
give_away_a_ferrari();
}
if( func( x, y, z ) )
{
give_away_a_ferrari();
}