M
mdh
May I ask this.
Given the declaration:
int myf( int, int);
and a function pointer:
(*fp)=int myf(int, int);
where I am initializing fp to point at myf....or trying to..
int main (){
i=myf (3, 4);
return 0;
}
A definition of:
int myf( int a, int b){
return a+b;
}
What goes on in the workings of C when myf is called, and how does
this differ from calling myf like this?
(*fp)(3,4);
If I am not that clear with this question, then it is because I am not
that clear about what I am asking, but I am trying to get a conceptual
picture of what happens when functions are called....and marrying this
idea with function pointers. I may be making it a lot more complicated
than it really is....which is more than likely.
Well, here goes...and wearing the usual head protective gear for all
the answers
Given the declaration:
int myf( int, int);
and a function pointer:
(*fp)=int myf(int, int);
where I am initializing fp to point at myf....or trying to..
int main (){
i=myf (3, 4);
return 0;
}
A definition of:
int myf( int a, int b){
return a+b;
}
What goes on in the workings of C when myf is called, and how does
this differ from calling myf like this?
(*fp)(3,4);
If I am not that clear with this question, then it is because I am not
that clear about what I am asking, but I am trying to get a conceptual
picture of what happens when functions are called....and marrying this
idea with function pointers. I may be making it a lot more complicated
than it really is....which is more than likely.
Well, here goes...and wearing the usual head protective gear for all
the answers