C++ use of Malloc/Realloc and Free

Jerry Feldman gaf at blu.org
Sat Jun 21 09:37:32 EDT 2003


In last Wednesday's meeting we talked briefly about realloc. While there
are some good reasons to use realloc in C++, using these functions are
dangerous. First, in C++ a struct is treated by C++ as a class, complete
with constructors and destructors. In general, most C++ programmers
treat them as simply data, but C++ does give them default constructors
and destructors.  In most cases this will not be a problem, but it may
cause some problems. 

-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20030621/7e4628e3/attachment.sig>


More information about the Discuss mailing list