Defining a Pointer

Hello guys,
A very small syntax question.
I want to declare a pointer p.
Are the two declarations below identical actually?

int* p; VS int *p;
Yup, there's only one difference:
int* p, q, e; makes them all pointers, whereas int *p, q, e makes only p a pointer
so that means int* p, q, e are the same as int *p, *q, *e? and i can define these pointers either way?
Exactly, and I'm not 100% on what happens if you do int* *p; either it won't compile or you'll probably end up with a int**, not sure which
@boscomanilow128

These two records

int* p;
int *p;

are equivalent.


@sargon94 (245)
Yup, there's only one difference:
int* p, q, e; makes them all pointers, whereas int *p, q, e makes only p a pointer


It is invalid statement. In the both cases only p will be declared as a pointer.
It is invalid statement. In the both cases only p will be declared as a pointer.


Blah? that's strange... I seriously thought that using int* made every variable (pointer) after that a type int*. what the f*** is the point of having 2 things that both do the same? (I believe you, I'm just confused as to why that is)
Topic archived. No new replies allowed.