TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CHRISTIAN S. PEDERSEN
from: CHRISTIAN KOTZ
date: 1997-07-12 00:31:00
subject: Deleting a Class.

Hello Christian!
reply to a message from Christian S. Pedersen to All:
 CSP> If I "delete" a Class, allocated with "new", will the Class'
 CSP> destructor be called ?
You do not "delete" a class (this can't be done since class is a *type* ), 
You delete an instance of a class dynamically allocated by new.
delete on a dynamic class instance does:
1st   execute the destructor (+ base class destructors, most derived ones 
first)
2nd  free the memory (either by global ::delete or if You wrote Your own 
YourClass::operator delete by that)
bye, Christian!
---
---------------
* Origin: for(;;)full()?sleep():eat(); (2:310/78.19)

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™.