开发者

How to understand these complicated pointer declarations? [duplicate]

开发者 https://www.devze.com 2023-03-27 21:24 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Complex Declarations Can someone help me to break this down, and help me to understand?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Complex Declarations

Can someone help me to break this down, and help me to understand?

1) char *(*(*a[N])( ))( );

2) char (*开发者_开发问答 (*x[3]) ( ))[5];

3) char (*(*f( ))[ ]) ( );


The golden rule is. just use http://cdecl.org/:

  1. declare a as array 5 of pointer to function returning pointer to function returning pointer to char (I replaced N with 5)

  2. declare x as array 3 of pointer to function returning pointer to array 5 of char

  3. declare f as function returning pointer to array of pointer to function returning char

To understand how to interpret them yourself, this is a very good explanation from MSDN: Interpreting More Complex Declarators.

0

精彩评论

暂无评论...
验证码 换一张
取 消