G
Guest
Hello all. I'm learning C# after years of C++ and I'm having some trouble getting used to the concept of "garbage collection". I understand that an object is created using the "new" keyword and it doesn't require manual de-allocation due to the garbage collection scheme. But what about scope? In C++ a dynamically allocated object is persistant until it is de-allocated. What happens in C#? Is it flagged for cleanup when it exits the local code block? If so, how do I make an object persistent? If not, when I'm done with the object how should I indicate to the framework that it should flag that object for garbage collection?
Thanks in advance, everyone. I can see GC will take some getting used to...it runs counter to all my instincts!
Thanks in advance, everyone. I can see GC will take some getting used to...it runs counter to all my instincts!