I found this line of code in some code I’m analyzing:
Mintau = (double*) malloc(FadeAll.num_paths*sizeof(double));
I also found a question on here (that was a duplicate of other questions it appears) that explains different syntax of pointers including:
int *ptr;
int * ptr;
int* ptr;
I should explain that I fully understand that all three of the above are saying the same thing. The last one is the one that most closely resembles my line of code. What I was wondering is why double has to be in parenthesis in this case? I apologize if this is a duplicate question but I couldn’t find any regarding this.
There are no difference between this three declarations:
(double*)has to be in parenthesis because it is a Cast.Read a little about casting in this link
Hope it helps.