Hi everyone;
[SOLVED]
I make a try to use a pointer to function. However I get a garbage value. Could you please check my code?
Edit: I see when I use printf("%d",c); instead of printf("%d",*p); I get the correct result. I wish I was able to delete the post.Code:#include <stdio.h>
int main(void){
int (*p)(int,int);
int f1(int x, int y);
p=f1;
int a=5;
int b=3;
int c=(*p)(a,b);
printf("%d",*p);
return 0;
}
int f1(int x, int y){
return ((x+y)*(x+y));
}