+ 5
Pointers in c++
What’s the difference between int* v and int *v?
2 Respuestas
+ 2
they are same in fact
+ 8
No difference when there's only one definition in the line. Difference will be noticeable when multiple variable are defined in a single line.
int* a, b, c;
// Here <a> is an `int` pointer, <b> and <c> are `int`
int *a, *b, *c;
// Here <a>, <b> and <c> are all `int` pointers
int *a;
int* b;
// No difference, only one variable definition per the line.