JS said:
Just a bit misleading because of the missing blank followed by the "*".
Would seem a bit more clear if one wrote:
char * alloc(int n)
It is the same as
2+3
you can write it any way you want
2+ 3
2 +3
2 + 3
it always means the same thing: the addition of 2 and 3
There is a possible pitfall with that pointer-'*' however:
Actually the situation is this:
The '*' belongs more to the thing on its right then to the thing
on its left. In case of function return types this makes no difference.
But consider:
int* i, j;
What does this define?
Well. It defines a pointer variable named 'i' and (surprise) it defines
an int variable named 'j'. Note: 'j' is an int (!) not a pointer to int (!).
That's why most C programmers prefer to write
int *i, j;
to make this clear without any doubt.
In C++ much less pointers are used, and most programmers agree, that there
should be only one variable defined in each definition, thus a C++ programmer
would write:
int *i;
int j;
and now the whitespace can easily be moved to the data type without fooling
anybody:
int* i;
int j;