Function which is returning pointer to function in c programming.
#include
double (*lic())(double);double(*p)(double);void main(){ p=lic(); clrscr(); printf("%.2lf",(*p)(M_PI_4)); getch();}double (*lic())(double){ p=&sin; return p;}Output:0.71ONE MORE EXAMPLE:float calculate();float (*show())();void main(){ float b; clrscr(); b=(*show())(); printf("%f",b); getch();}float calculate(){ float a=5.5; a+=5<=5;
No comments:
Post a Comment