Unmanaged memory – using malloc( ) / free( )

The basic way to allocate memory to your computer program in C (which is still possible to use in C++) is by using the malloc() function. This function designates a block of the computer system's memory for your program's use. Once your program is using a segment of memory, no other program can use or access that segment of memory. An attempt to access a segment of memory not allocated to your program will generate a segmentation fault, and represents an illegal operation on most systems.