Newing arrays with auto_ptrs??

Started by
-1 comments, last by Void 23 years, 9 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