In your first example you declare a pointer with...
// declare an int variable and an int pointer variable
int number;
int* pointer; <-- no space between 'int' and '*'
In the second example...
// use the asterisk to _declare_ a pointer
int * numberPointer; <-- space between 'int' and '*'
I compiled and ran both with and without the space between 'int' and '*', and it doesn't make a difference. Little things like this can through you off if you are trying to learn syntax.
by Steffen Frost — Sep 28
In your first example you declare a pointer with...
// declare an int variable and an int pointer variable
int number;
int* pointer; <-- no space between 'int' and '*'
In the second example...
// use the asterisk to _declare_ a pointer
int * numberPointer; <-- space between 'int' and '*'
I compiled and ran both with and without the space between 'int' and '*', and it doesn't make a difference. Little things like this can through you off if you are trying to learn syntax.
Just a nit.