Skip to main content

Thread: Quick C++ vector question


hi,
trying clean vector contains pointers class "file".
site at
http://www.cplusplus.com/reference/stl/vector/clear/
says vector method "clear()" before removing elements calls destructors, in case destructors don't called.

cause i'm using pointers elements instead of elements or else?

quote posted kahumba view post
is cause i'm using pointers elements instead of elements or else?
yes. "element" vector holds pointer-to-object not object itself. have manually "delete" each pointer before clear()


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] Quick C++ vector question


Ubuntu

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???