I am currently self-learning C and C++.
I couldn't find a similar question but I would like some good explanation with a focus on C and C++ design practices.
return()
?To illustrate:
bool A (blah, blah)
{
bool a = false;
a = B(); // B returns bool type
return a;
// OR
return (B());
}
If you plan on doing something with the return value of B
before returning from A
, go ahead and store it. If the return value of B
will be the return value of A
, then just return B()
.