See bo article: http://www.cnblogs.com/fangyukuan/archive/2010/09/18/1829871.html
Doubtful 1
You cannot return a reference to the memory that is allocated inside the function (this should be noted, many people do not realize, haha ...) ). This article can refer to effective c++[1] Item 31. Although there is no passive destruction of local variables, there are other embarrassing situations in which the case (a reference to new allocation of memory within the function) is returned. For example, a reference returned by a function is only present as a temporary variable, not given an actual variable, and the space pointed to by the reference (allocated by new) cannot be freed, resulting in memory leak.
Doubtful 2
You can return a reference to a class member, but preferably a const. This principle can be referenced by effective C++[1] Item 30. The main reason is that when an object's property is associated with a business rule, its assignment is often related to the state of some other attribute or object, so it is necessary to encapsulate the assignment in a business rule. If other objects can get a very good reference (or pointer) to the property, the simple assignment of that property will break the integrity of the business rules.
Doubtful 3
C + + face question suspect 1