I\'m getting started developing for the iPhone and as such I am looking at different tutorials online as well as trying some different things out myself. Currently, I\'m try
Also, I've noticed at different places and at different times the asterisk (
*
) is located either right after the timeNSDate* now
or right before the variableNSDate *now
. What is the difference in the two and why would you use one versus the other?
The compiler doesn't care, but putting the asterisk before the space can be misleading. Here's my example:
int* a, b;
What is the type of b
?
If you guessed int *
, you're wrong. It's just int
.
The other way makes this slightly clearer by keeping the * next to the variable it belongs to:
int *a, b;
Of course, there are two ways that are even clearer than that:
int b, *a;
int *a;
int b;