You don't use the garbage collector. It's just there in the presence of
..Net's Common Language Runtime. It reclaims the memory occupied by objects
that you create dynamically when there are no longer any references to them.
You use the "_gc" syntax in Managed C++ to mark a class as being on the
managed heap - the one which the garbage collector control. In other words
you use it to allocate instances of classes which are compatible with the
..Net object model in a "dialect" of C++ crafted especially for .Net. You can
start reading about that here:
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.