you need it for dynamic memory allocation. just think of a program where sb has to input a n-dimensional matrix of unkown n. let the user input n and then go forward to get the necessary memory space.
next advantage of malloc is that all the memory-places allocated stick next to each other. if you would set up static variables, their locations would be at random places. for example you want to allocate a dynamic nxn-matrix:
double *matrix;
int n;
printf("input dimension:");
scanf("%d",&n);
matrix=(double*)malloc(n*sizeof(double));
malloc is a void function so you have to bring it into a any pointer type like (int*),(float*),or(double*)
matrix then represents the start address of your memoryspace allocated.
You can access these spaces like following:
scanf("%lf",matrix[i]); // i=0,1,2...,n-1
//that should be the same as
scanf("%lf",matrix) //for i=0
//or
scanf("%d",matrix+3); //for i=3
you wont need the address operator "&" cause pointers are adresses.