-2

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;
Bharath Kumar
  • 541
  • 3
  • 10

1 Answers1

0

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;
svdragster
  • 141
  • 2
  • 7