|
On Thu, 29 Jun 2006 22:18:32 +0200 Boris <bbresc512@xxxxxxxxxx> wrote:
how, for example, a function like ctime() works. It looks like it allocates char[25] every time it's called without ever freeing the memory.
I think many older functions are written to return a pointer to one of their local variables. inet_addr is one example I can think of off the top of my head. It's not really allocating on every call. It just writes to its local buffer and returns the pointer to it.
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.