TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: PATRICK SUNG
from: CAREY BLOODWORTH
date: 1997-07-05 21:12:00
subject: DJGPP Questions???

PS>   In the standard C++, I use the 'new' operator to allocate dynamic 
memory,
PS>   however, in DJGPP, I have read the INFO docs on new and it says the new
PS>   operator used the 'malloc' function to allocate memory. Is it the true 
an
PS>   which one is better in DJGPP(new or malloc)?
YOU should always use new.  A 'new' is not the same as a 'malloc'
because with a 'new', the compiler will also call the constructors.  It
doesn't do that for malloc calls.
How the compiler choses to allocate the memory doesn't really matter too
much.  A compiler can have two heaps, if it wants too, and always do the
new from the second heap.  And the new could even be redefined to some
custom version that some class happens to need.
For a class, you should always call new and not malloc.
--- QScan/PCB v1.19b / 01-0162
---------------
* Origin: Jackalope Junction 501-785-5381 Ft Smith AR (1:3822/1)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.