

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


























Today’s Lecture How memory allocation is done in C++ How is it different from C style Advantages of memory allocation in C++ Uses of memory allocation
Pointers to a class
malloc ( ) ; calloc ( ) ; realloc ( ) ;
malloc ( 10 * ( sizeof ( int ) ) ) ;
new
new int ;
new char ; new double ; Example
delete
int * iptr ; iptr = new int [ 10 ] ; Example
Example
Example
dptr = new Date ;