Re: Function pointers
Glynn Clements <[email protected]>
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <[email protected]> |
kumar11 wrote: > Could you please explain the meaning of below declaration statement. > > char (*pa())[4]; "pa" is a function returning a pointer to an array of four characters. C declarations work by declaring an expression involving the identifier as having a named type (in this case, "char"). "(*pa())[i]" is a character, for 0 <= i < 4. Therefore: "(*pa())" is an array of four characters. Therefore: "pa()" is a pointer to an array of four characters. Therefore: "pa" is a function returning a pointer to an array of four characters. -- Glynn Clements <[email protected]>