#includeint Dolt(float a,char b,char c){printf("Dolt\n");return int(a+b+c);} void passPtr(int (*pt2function)(float a,char b,char c)){ int result=(*pt2function)(12,'a','b');// call using function pointer; printf("%d\n",result); } int main(){ //pass a function pointer as an argument passPtr(&Dolt); getchar();getchar(); return 0; }
Showing posts with label Pass a Function Pointer as an Argument. Show all posts
Showing posts with label Pass a Function Pointer as an Argument. Show all posts
Sunday, August 28, 2011
Pass a Function Pointer as an Argument
লেবেলসমূহ:
Pass a Function Pointer as an Argument
Subscribe to:
Posts (Atom)