|
Don't you mean returning a pointer to a STATIC variable local to the procedure, or a global variable in the module? Returning a pointer to a local (automatic) variable in a procedure may work for some cases. (Likely the cases used for your unit tests.) But fail it will, and the symptoms will be hard to debug.
Cheers! Hans
Is this because the storage is normally reclaimed after the calling program ends? Or does it reclaim it when it "needs" the extra storage? Or after the call to the subprocedure that non-static storage is now available for any other app to use?
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.