Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>new try to create object by allocating heap space</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 new                     Try to Create Object by Allocating Heap Space

 my_pointer_to_name = new name;

    The new operator attempts to create an object by allocating
    sufficient bytes on the heap for it (i.e. it tries to allocate
    sizeof(object) bytes). It's an easy was of using the heap; for
    example:

               my_name *my_nameptr;
                :
                :
               my_nameptr = new my_name;

    A NULL pointer is returned if new was unsuccessful.

See Also: delete

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson