Archived

This topic is now archived and is closed to further replies.

Newing arrays with auto_ptrs??

This topic is 6363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites