position of * when declaring pointers in C

Hi,

I'm learning about passing pointers as arguments to functions.

I'm wondering if there is a difference between the following notation?

void function(char* name)
void function(char *name)

The code as I expect using both notations but I'm wondering if people use the notation interchangeably?

Thanks

No difference at all, but remember that the * binds to the variable, so if you're defining something like int* var1, var2;
"var1" is a pointer to int, but var2 is just a plain int.

c/c++ compilers pay almost no attention to "white space" in the source code, so those two statements are functionally identical.

These two statements are also functionally identical:

char *s = "12345";
char
*
s
=
"12345"
;

Regards,
Ray L.

No difference at all, but remember that the * binds to the variable, so if you're defining something like

So, it is better to write it with variable name.

int *var1, var2;

. . . or is it better to define each variable with its own type? (my preference)

many thanks