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]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.