Z
zhongshu
int **a[10];
int *(*a)[10];
int (*a[10])();
int *(*a)[10];
int (*a[10])();
> int **a[10];
> int *(*a)[10];
> int (*a[10])();
int **a[10];
declare a as array 10 of pointer to pointer to int
int *(*a)[10];
declare a as array 10 of pointer to pointer to int
Dik said:int **a[10];
declare a as array 10 of pointer to pointer to int
int *(*a)[10];
declare a as array 10 of pointer to pointer to int
int (*a[10])();
declare a as array 10 of pointer to function returning int
cdecl is your friend.
Dik said:int **a[10];declare a as array 10 of pointer to pointer to intint *(*a)[10];declare a as array 10 of pointer to pointer to intint (*a[10])();declare a as array 10 of pointer to function returning intcdecl is your friend.
cdecl is indeed a great tool. It is discussed in K&R. The man page for
it is really kewl as it contains examples, grammar etc.
But I was wondering if there is a systematic method to do it yourself.
I mean a step by step human understandable approach
Robert Gamble said:Dik said:int **a[10];declare a as array 10 of pointer to pointer to intint *(*a)[10];declare a as array 10 of pointer to pointer to intint (*a[10])();declare a as array 10 of pointer to function returning intcdecl is your friend.
cdecl is indeed a great tool. It is discussed in K&R. The man page for
it is really kewl as it contains examples, grammar etc.
But I was wondering if there is a systematic method to do it yourself.
I mean a step by step human understandable approach
Yes, see http://www.ericgiguere.com/articles/reading-c-
declarations.html.
Robert Gamble
guoliang said:good answer!
Terrible answer. It was top-posted, losing all connection with the
actual problem. Your answer belongs after the material to which
you reply, after snipping anything immaterial.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.