I have a question about creating optimal C++ program.
I have a function that computes expressions like:
c= a/2
c = (a*b)/2
c = (a/2) + b
etc.
is it better to use a variable to store these values or just use return <expression>
?
I understand creating variable will take space and return <expression>
would avoid that. But if these are several returns, does it create more overhead than declaring a variable?