C

malloc()

Examples

int *x;
if ((x = (int *)malloc(sizeof(int) * 200)) == NULL) {
  printf("memory allocation failure.\n");
  exit(1);
}

allocates memory for 200 integers. x points to the memory address.

free(x);

to free the allocated memory space again

Segments

Heap Segment