Q:

When is it valid to return a reference? A reference to const

0

When is it valid to return a reference? A reference to const?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

When the object is not a local object, then that's fine to return a reference to it.

When we don't want the reference returned from a function to be an lvalue, we should use a reference to `const` as the return type instead.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now