Re: passing pointers [C]
From: Stephen Ramsay (sramsay_at_uga.edu)
Date: 07/09/04
- Previous message: Snake: "Heap? what does it mean?"
- In reply to: Barry Schwarz: "Re: passing pointers [C]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 09 Jul 2004 05:18:19 GMT
On 2004-07-08, Barry Schwarz <schwarzb@deloz.net> wrote:
> Since you only call realloc, there is no way for old allocations not
> to be released. Your problem stems from the fact that you are using
> it incorrectly and invoking undefined behavior.
>
> Part of you confusion would probably disappear if you let the function
> return the address of the newly reallocated memory instead of trying
> to be fancy with the double pointer.
Thanks to you (and to Bob above). It's now working like a charm. I got
rid of the double pointer business (it seemed a bit too clever for its
own good, but I had managed to convince me that this was the only way to
do it).
Note to self: You can't reallocate what wasn't allocated in the first
place.
Thanks again . . .
Steve
-- Stephen Ramsay Department of English University of Georgia web: http://cantor.english.uga.edu/
- Previous message: Snake: "Heap? what does it mean?"
- In reply to: Barry Schwarz: "Re: passing pointers [C]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|