pointer to function in c with detailed example

Answer:

char hemmed(short,int);
char (*burnley)(short,int)=hemmed;
void main(){
char c=(*burnley)(33,33);
clrscr();
printf("%c",c);
getch();
}
char hemmed(short x,int y){
return x+y;
}

Output: B
Explanation: Here burnley is pointer to such function which return type is char type data and first paramer is short int and second parameter is int.

No comments: