Anytime I write C code, I try to keep the asterisk close to the type:
void* foo(void* bar);
I know that the asterisk technically belongs with the variable name when declaring it, but it helps to wrap my head around them, as a reminder that they're a pointer type.
I agree you based on fact that more in code we use
void *s = then use it as
s=
But I agree more that the
void* s = then use it as
s=
Is more understandable as the first set confuse me when I learn pointer. It still does. void* is a type like statement. And void is like a return type statement.
As long as you're not using prehistoric versions if C, you don't have to define all variables up front, so there is much less justifiable reasons for that kind of multiple declaration.
void* foo(void* bar);
I know that the asterisk technically belongs with the variable name when declaring it, but it helps to wrap my head around them, as a reminder that they're a pointer type.