O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

New Operators and Features

There are a few items that are of importance to a beginning C++ programmer that qualify as extensions to the language. As mentioned, there are many intricacies of C++ as a language in its own right, but the following items are specifically aimed at those wanting to take advantage of C++ without all the baggage.

First, the C++ language introduces new and delete as replacements for malloc and free. In other words, memory management has become part of the language proper. It is no longer necessary to specifically allocate a sized memory chunk for a character string, because you can now use code such as:

char * szString = new char [255];

This is the equivalent to:

char * szString = (char *) malloc ( sizeof (char) * 255 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required