i wonder if i create an object from a class using new operator, and if i dont delete that object when i am finished using it, does it still remain in the memory after the program reaches the and of the main function?
Thanks
serkan sendur 821 Postaholic Banned Featured Poster
Recommended Answers
Jump to PostYes, it does remain. If new operator is used u need to delete explicitly.
What the fuck are you talking about? When the program ends, nothing remains.
Jump to PostIt doesn't remain "in memory" because the process has completed and all of its memory is reclaimed by the operating system.
Jump to PostWell that depends on your OS.
Your average desktop with an OS which runs each process in a separate address space will reclaim the space when the program exits.
But if you're programming on say a mobile phone, where there is no virtual memory, and not a lot …
Jump to PostAlso, it's important to delete them because they might have other stuff to do (like flushing data to filehandles, and such).
All 13 Replies
da penguin 26 Newbie Poster
serkan sendur 821 Postaholic Banned Featured Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
da penguin 26 Newbie Poster
da penguin 26 Newbie Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
serkan sendur 821 Postaholic Banned Featured Poster
Salem 5,265 Posting Sage
serkan sendur 821 Postaholic Banned Featured Poster
Salem 5,265 Posting Sage
Rashakil Fol 978 Super Senior Demiposter Team Colleague
mattwaab 20 Newbie Poster
Free_Classified 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.