I read such an example:
double * ptd;
ptd = (double *) malloc(30 * sizeof(double));
It explains that
malloc() allocates memory but it doesn't assign a name to it. However, it does return the address of the first byte of that block.
Since malloc return the the address of the first byte of that block
, I assume the correct way is assign the address to ptd directly without star(*).
ptd = malloc(30 * sizeof(double));
The extra * would dereference the address.
What's wrong with my assumption?