C++Tutorial for Beginners 48 - Allocating Memory

One of the great things about C++ is that it allows you to manage memory down to the byte. Although this is not an easy business, it allows your C++ programs to be incredibly efficient and stops them doing the programming equivalent of taking a coffee break while your user is trying to shoot the monster in your latest 3D epic shooter, since there's no garbage collector randomly running to free memory.

In C++, you have to scrupulously free all memory yourself. In this tutorial we'll take a look at the basics of dealing with memory, using the "new" operator.'

 



Click here to download source code for this tutorial.