C++ Language/ProgramFlow/ReturnValue

From Wikibooks, open books for an open world
Jump to navigation Jump to search

It would be unsafe to return a reference to a local variable, but you can return a reference to a data member.

Additional information about valid return types (includes interactive examples)