Original Post
My question is this: Suppose I use a vector in an arbitrary function like so, std::vector vec; myclass *tempclass = new myclass; vec.push_back( *tempclass ); When the vector is destroyed ( from the stack returning ), will the memory from the "new myclass" be freed up automatically? Or will I have a memory leak? If this causes a memory leak, what is the proper way to use a vector with dynamically allocated memory? Thanks much, jujumbura