I'm studying C and have some question about dynamic memory allocation syntax.

The code below is an example of dynamic memory allocation. If I understand correctly

```
 (char *) malloc (50 * sizeof (char));

```

will return a pointer to a data type of char
and

```
  pr = (char *) malloc (50 * sizeof (char));

```

will assign the pointer 'pr' to the pointer declared when allocating dynamic memory. So we will have a pointer point to another pointer

```
#include <stdio.h>
#include <stdlib.h>

int main()
{
   char *pr;

   pr = (char*)malloc( 50 * sizeof(char) ); 

   return 0;
}

```

I still have a hard time understanding the syntax used to allocate dynamic memory. Can someone explain in detail? thank you