C Programming - Complicated Declarations
Exercise : Complicated Declarations - Yes / No Questions
1.
Is the following declaration correct?
typedef *void (*pfun)(**int, *float);
typedef *void (*pfun)(**int, *float);
2.
Is the following declaration correct?
char (* ( *f())[])();
char (* ( *f())[])();
Answer: Option
Explanation:
f is a function that returns a pointer to an array of pointers to functions that return a char.
3.
Is the following declaration correct?
char far *far *ptr;
char far *far *ptr;
Answer: Option
Explanation:
ptr is a far pointer to a far pointer to a char. (or) ptr contains a far address of a far pointer to a char
4.
Is the following declaration correct?
void(*f)(int, void(*)());
void(*f)(int, void(*)());
Answer: Option
Explanation:
f is a pointer to a function which returns nothing and receives as its parameter an integer and a pointer to a function which receives nothing and returns nothing.
5.
Are the following declarations same?
char far *far *scr;
char far far** scr;
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers