C - Data Types - Discussion

You Are Here :: Home > C > Data Types - Discussion

 



Q.

What will be output of following program?

#include
#include
int main(){
void (*p)();
int (*q)();
int (*r)();
p = clrscr;
q = getch;
r = puts;
(*p)();
(*r)("cquestionbank.blogspot.com");
(*q)();
return 0;
}

A. NULL B. careersadda.com
C. c D. Compilation error

Answer: Option B
Explaination:

p is pointer to function whose parameter is void and return type is also void. r and q is pointer to function whose parameter is void and return type is int . So they can hold the address of such function.



Discussion

Your Comments Goes here...
NameDiscussion