[Simh] The genius of C declarations
dave porter
dave_list_addr at verizon.net
Mon Jun 29 18:14:47 EDT 2015
>void (*sim_vm_init) (void)
>
>Well what is this. The function returns nothing and takes nothing
>right? What's the *sim_VM_init in parenthesis referring too? That's my
>question.
void foo(void) says 'foo' is a function taking no args and returning no
value
void (*bar)(void) equally says '*bar' is a function taking no args and
returning no value
therefore bar is a pointer to a function taking no args and returning value
Contrariwise,
void *bar(void) would say 'bar' is a function taking no args and returning
a void*
which is to say, the parentheses around *bar are controlling precedence.
More information about the Simh
mailing list