This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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