0

The different between C++ and C# in memory managemnt

C# is managed memory and you don't have to afried about objects that dosent deleted by you because garbage collector is delete it for you. this is what called .NET. while C++ is unmanaged memory means that you have to delete every object in your hands or well be there memory leek. C# is .NET supported by default. C++ is not .NET by default. but can be if you add to complire /clr make C++ .NET and be like C# in memory management ONLY in managed class. i know it's little bit complecated so ask ;)

12th Nov 2016, 7:58 AM
George Rabbat
George Rabbat - avatar
2 Answers
0
the garbage collector only avilable in .NET framework that release the object from the memory. visual studio compiler support the /clr arg. c++ by nature is not .NET framework. but you can make it run under CLR (common languge runtime) the supported by .NET and included garbge collector. only .NET classes can garbge collector release but if a normal c++ class it want you have to release it be yourself
12th Nov 2016, 9:59 PM
George Rabbat
George Rabbat - avatar