Computer Science Canada Continued confussion with C++ |
Author: | klopyrev [ Wed Mar 07, 2007 1:51 am ] | ||
Post subject: | Continued confussion with C++ | ||
Assuming the two structures used in that method are defined, wouldn't that method not work properly since the method returns a local variable that would cease to exist when the method returns? KL |
Author: | wtd [ Wed Mar 07, 2007 2:29 am ] |
Post subject: | RE:Continued confussion with C++ |
No. The function works fine (assuming the struct types are properly defined). The struct is returned by value, rather than reference. |
Author: | klopyrev [ Wed Mar 07, 2007 2:35 am ] |
Post subject: | Re: Continued confussion with C++ |
Thanks for the response. I figured it out on my own after rereading the chapter about functions. KL |