Message from C, C++ discussions

December 2019

— Think of it like, if you use new, its sorta persistent, and will stay in memory until you free it. while if you just instanciate the object, it will get deleted once you leave the scope

Message permanent page

— 

Ok i got that,

whats if i didn't delete it and program end. will it still take memory or memory free after program end

— It *should* not

— It depends on your OS though

— But if youre on your "default" machine, it should be free'd by the os

— 🤔 ok
i should seriously take care of that

— Thanks

— Its probably fine, if your program isnt running on really exotic platforms

— Sorry can you help me?

— You should really use delete, otherwise you'll have a memory leak. Surely it will be freed once the programs ends, but you don't really care about that. You'de better use smart pointers

Message permanent page

— #meta

— No need for meta questions. Just ask directly!

"Any $x developer?"

Probably. Just ask your question and somebody will help!

http://dontasktoask.com

Message permanent page