|
On Fri, 27 Aug 2004 12:58:14 -0500 (CDT) Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote: > > Hi Brad, > > > 1. I assume the same holds true if you use a parameter > to > > return a pointer to local storage in the subprocedure. > > This is not a pointer passed in, but a parameter used > as a > > return value. > > It really has nothing to do with how the pointer is > passed or whether the > pointer is static. It has to do with when the memory that > it points to is > allocated & deallocated from the system. > > When a subprocedure starts, memory is allocated for all > of it's local > variables. When it ends, that memory is deallocated. > > It doesn't matter if the POINTER is static, it matters if > the memory that > it POINTS TO is static. > Sorry, I worded that wrong.. you corrected me. :)
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.