Possible Duplicate:
In C, what is the correct syntax for declaring pointers?
I am fighting with the c language. Pointers are new to me, and I think I am getting closer and closer to understanding them.
I have though one questions.
What is the difference between:
int k = 4;
int* pcp = &k;
and
int k = 4;
int *pcp = &k;
I cant seem to find any difference between these declarations of the pointer, is it just syntactical sugar – or is there any difference?
Thanks
There is no difference in those declarations, but there is a difference between the following two declarations:
and:
that might be hidden by your example.
So I prefer the second declaration.