In this declaration
my_struct * create(char *name);
the name of the function is create
. The function has one parameter of the type char *
, And the function has the return type my_struct *
. That is it returns a pointer to an object of the type my_struct
.
Is there any difference in the meaning of * in my_struct* and *name
my_struct
is a type specifier. So my_struct *
is a pointer type. name
is identifier that denotes the name of a parameter. The type of the parameter (identifier) name
is char *
.
Pay attention to that these declarations of the parameter are the same
char* name
char * name
char *name
that is the type of the parameter is char *
and the name of the parameter is name
.
In a function declaration that is not at the same time its definition names of parameters may be omitted.
So the above function declaration can be also written like
my_struct * create( char * );