Advertisement

Newing arrays with auto_ptrs??

Started by July 14, 2000 03:42 AM
-1 comments, last by Void 24 years, 5 months ago
For legacy reasons, I need to allocate an array pointer of a own defined type and access the buffer.. Is it possible to encapsulate it within a auto_ptr or something similar so it gets stack based rather than heapbased? Something like
        
   MyType   *var;   // self defined type


   var = new MyType[10];  // need to allocate buffer


   // have to access the var buffer like var[1]

        
Please?.. Edited by - Void on 7/14/00 3:44:08 AM

This topic is closed to new replies.

Advertisement