Many seem to be occasionally having these doubts. So posting it here.
What is the difference in below declarations?
int* x;
int *x;
Are the below declarations same? Is b a pointer in both declarations?
int* a, b;
int *a, b;
Many seem to be occasionally having these doubts. So posting it here.
What is the difference in below declarations?
int* x;
int *x;
Are the below declarations same? Is b a pointer in both declarations?
int* a, b;
int *a, b;
See Correct way of declaring pointer variables in C/C++
There is no difference.
Please note that
int* a, b;
int *a, b;
is NOT the same as
int* a, *b;
int *a, *b;