Translating to C++ from Java

Java handles pointers and memory management implicitly. In C++, your application is responsible for allocating and deallocating memory, and for performing any necessary pointer arithmetic.

Translating to C++