I am studying pointers for c and this placement of *
really really confuses me.
I understand what int *a
is..
But what is
a = malloc(n * sizeof(int) )
I understand what above is doing but why is *
in the middle of by itself?? This part really confuse me so please someone can explain to me?
unary *
means dereferencing and binary *
means multiplication.
The *
in the middle is a multiplicative operator. The result of the binary *
operator is the product of the operands.
Do not confuse it with unary dereference operator which applies only on pointer objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With