You don't need to know pointers to manage memory. The gcnew operator in C++ 2008 is the counterpart to the new operator in Java. The only visible difference in C++ 2008 is that you use explicit ^ notation to specify reference variables initialized with gcnew.
Otherwise you work with reference data in much the same way as you work with it in Java.
Additional notational patterns in C++ .NET explicitly has you document the nature of each of your programming elements (e.g., object, class, reference element, value element). This better reveals the inner workings of your code and helps you and and other programmers working with you make better efficiency and design trade-offs. The book is full of ample examples to make these code patterns easy to understand and comfortable to work with.
Like Java, reference elements created with gcnew are automatically deleted when they are no longer needed.
In addition to this Java compatibility of usage, you still have the benefit of access to native C++ and legacy C pointers along with backward compatible operation of the native C++ new and delete keywords covering the 40+ years of C, native C++, and C++.NET language syntax evolution as discussed in chapter 19.
Rogerio Kioshi wrote:Hi,
Is it necessary to know pointers and how to manage memory allocation to program in C++?
If it is, I prefer programming in Java...
People don't care how much you know until they know how much you care -- Cavett Robert
subject: Do I need to know pointers to program in C++?