Managed C++ value types and managed pointers.
I am basically a C++ and C# programmer and a beginner in the field of Managed C++.NET
I have few doubts, please pardon me if they seem senseless or absurd.
1) What is the difference between a managed pointer and unmanaged pointer, apart from _gc and _nogc syntax??
I want to know the way these pointer are allocated and how they work exactly. In main function and when defined as a part of managed and unmanaged classes.
2) In a book i read...
Besides being allocated on stack, value types can be allocated on unmanaged C++ heap using the __nogc new operator, but cannot be allocated on managed heap using the __gc new operator unless you define a managed pointer to value type.
could not understand the above marked part. How can we actually define a managed pointer to a value type??
3) In another article i read...
Pointers to value types are managed by default.
means if i define my _value struct or class, the pointers to them will be managed?? howcome, Managed pointers can point to value types?? :confused:
I request a fair explanation and also links to some good artciles which can answer and explain me these things in detail.
thanks in advance. :)