I am new to c++ and i couldn't find anywhere what is the difference between when you put the '*' after the type or before the name. For example waht is the difference between the two:
int *p;
int* p;
I am new to c++ and i couldn't find anywhere what is the difference between when you put the '*' after the type or before the name. For example waht is the difference between the two:
int *p;
int* p;
C compiler ignores the whitespace (except whitespace inside character constants and string literals).
It means that
int * p;
int*p;
int* p;
int *p;
int * p ;
mean exactly the same.
The white space is only important in macros for example:
#define a(x) ((x)+(x))
#define a (x) ((x)+(x))
mean something completely different.