In C++ we have the operator new and operator delete. These are intended to replace malloc() and free() in the C standard library.
Allocating a array of 100 integers is done in C as follows:
int* is;
is = (int*)malloc(sizeof(int) * 100);
…
free((void*)is);
With new/delete in C++, it can be rewritten as:
int* is;
is = new int[100];
…
delete is;
Note that you should use the delete[] operator in this case. The last line should be:
delete[] is;
Always match new with delete, and new[] with delete[].