In C++, what does & mean after a function's return type?

c++

Solution

Yes, the `int&` version returns a reference to an `int`. The `int` version returns an `int` by value.

See the section on references in the C++ FAQ

Problem

In a C++ function like this: ``` int& getNumber(); ``` what does the `&` mean? Is it different from: ``` int getNumber(); ```

Original source