hi guys .. could any one tell which one is bette..
code1:
result add ( int a , int b )
{
return ( a+b) ;
}
code 2:
void add ( int a , int b , int result)
{
result = a+b ;
return result;
}
which one is better whether the code1 or code 2
Dont consider about the temp variable.. what I need whether its better to use the return statement or in the parameters itself we could pass the reference..
code1:
result add ( int a , int b )
{
return ( a+b) ;
}
code 2:
void add ( int a , int b , int result)
{
result = a+b ;
return result;
}
which one is better whether the code1 or code 2
Dont consider about the temp variable.. what I need whether its better to use the return statement or in the parameters itself we could pass the reference..
Comment