VC++.NET

G

Guest

Can u brief abt how to use the _gc(Garbage Collector) in VC++.NET.Plz give me
an example
 
W

William DePalo [MVP VC++]

Partha said:
Can u brief abt how to use the _gc(Garbage Collector) in
VC++.NET.Plz give me an example

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:

http://msdn.microsoft.com/library/d...netstart/html/cpcsvbvcjscript_managed_c__.asp

Regards,
Will
 

Ask a Question

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.

Ask a Question

Top