Never return a pointer or reference to a local stack object, a reference to a heap-allocated object, or a pointer or reference to a local static object if there is a chance that more than one such object will be needed.
转载于:https://www.cnblogs.com/zhtf2014/archive/2011/03/27/1996769.html