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 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.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.