A Question about new vs malloc and realloc.
From: DrBob (bobrien18_at_yahoo.com)
Date: 11/26/03
- Next message: .oO LGV Oo.: "Re: vector"
- Previous message: DrBob: "Questions about the string class."
- Next in thread: Victor Bazarov: "Re: A Question about new vs malloc and realloc."
- Reply: Victor Bazarov: "Re: A Question about new vs malloc and realloc."
- Reply: Unforgiven: "Re: A Question about new vs malloc and realloc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Nov 2003 13:41:32 -0800
gcc 3.3 on Mac OS X.
I need to dynamically grow a buffer by concatinating raw binary data
in chunks.
How do I use 'new' to grow the buffer size as its contents grow? I
know this can be done with realloc.. (realloc will give you a new
pointer to a new buffer that has the same contents as the previous
buffer and will free the previous buffer for you).
Perhaps there is a different class I could be using?
- Next message: .oO LGV Oo.: "Re: vector"
- Previous message: DrBob: "Questions about the string class."
- Next in thread: Victor Bazarov: "Re: A Question about new vs malloc and realloc."
- Reply: Victor Bazarov: "Re: A Question about new vs malloc and realloc."
- Reply: Unforgiven: "Re: A Question about new vs malloc and realloc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|