VC++.NET

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Back
Top