Re: Re: Re: Function pointers
Glynn Clements <[email protected]>
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <[email protected]> |
simon wrote: > char (*pa())[4]; > is this mean that an pa function pointer with return value like a char a[4] and it's argument is nothing ? > > right? Wrong. 1. pa is not a pointer to a function, it's a function which returns a pointer. "()" has higher precedence than "*", so "*pa()" is parsed as "*(pa())" (function returning pointer) rather than "(*pa)()" (pointer to function). 2. An empty parameter list "()" indicates that the function takes unspecified arguments. A function which takes no arguments has "(void)" as the parameter list. -- Glynn Clements <[email protected]>