c_auto_ptr

Table Of Contents
c_auto_ptr

This object was created to aid programmers in the creation, and freeing of temporary arrays, and memory resources. It is most often used as an auto object, where it is kept in scope only while it is needed. Since it frees it's memory on destruction, it provides the programmer with a 'set and forget' technique for temporary memory allocation.

API Refrence

Example Code:
void i_need_temp_memory( void )
{
    c_auto_ptr buff(1024);
    sprintf( buff, "%s(%d) This is a temporary buffer...", 
             __FILE__, __LINE__ );
    cout << "buffer is: " << (char*)buff;
}

Up