J
jeniffer
What does the following declare?
char*(*(*x)(void))[];
How to judge these type of questions? I am confused
char*(*(*x)(void))[];
How to judge these type of questions? I am confused
WiINcdecl says:jeniffer said:What does the following declare?
char*(*(*x)(void))[];
How to judge these type of questions? I am confused
A pointer to a function taking no arguments, and returning a pointer to anjeniffer said:What does the following declare?
char*(*(*x)(void))[];
See http://www.c-faq.com/ question 1.21, and remind to whoever wrote thatHow to judge these type of questions? I am confused
What does the following declare?
char*(*(*x)(void))[];
How to judge these type of questions? I am confused
jeniffer said:char*(*(*x)(void))[];How to judge these type of questions? I am confused
WiINcdecl says:
declare x as pointer to function (void) returning pointer to array of
pointer to char
In General you'd have to work this from the inside (the inner most part,
here thr x) to the outside, alternatiting left and right
*x is a pointer
() to a function
(void) that takes no arguments
* and returns a pointer
[] to an array
char * of pointers to char
Bye, Jojo
jeniffer said:
What does the following declare?
char*(*(*x)(void))[];
Others have already answered this part of your question.
How to judge these type of questions? I am confused
Judge these types of questions harshly. The question you show is
practically meaningless, because it tests a skill that is only needed when
deconstructing and rewriting badly-written code.
jeniffer said:
What does the following declare?
char*(*(*x)(void))[];
Others have already answered this part of your question.
How to judge these type of questions? I am confused
Judge these types of questions harshly. The question you show is
practically meaningless, because it tests a skill that is only needed
when deconstructing and rewriting badly-written code.
What if you are writing a C compiler or something similar?
Shall the compiler error because the programmer used a 'bad' data
type?
jeniffer said:
What does the following declare?
char*(*(*x)(void))[];
Others have already answered this part of your question.
How to judge these type of questions? I am confused
Judge these types of questions harshly. The question you show is
practically meaningless, because it tests a skill that is only needed when
deconstructing and rewriting badly-written code.
What if you are writing a C compiler or something similar?
jeniffer said:What does the following declare?
char*(*(*x)(void))[];
How to judge these type of questions? I am confused
Look on the net for cdecl.zip
There are other distributions as well (e.g. in BSD code base)
Dann Corbit said:
I have done so. I even found it. The zip file was corrupted...
...so I found a version written by Graham Ross, supposedly converted to
ANSI C by David Wolverton, which didn't compile. Once I got it to compile
(by removing features), it didn't link. Once I got it to link (by removing
more features), it didn't run (segfaulted straight away).
The cdecl functionality is a perfectly good example of code that *could* be
written in solid, clc-conforming ISO C code. And who knows? Perhaps it has
been. If so, where may it be found? And if not, well, I'll add it to my
to-do list.
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.