qsort((void **)lineptr,0,nlines-1,[B][I](int(*)(void*,void*))(numeric?numcmp:strcmp)[/I][/B]);is it the normal way to pass a pointer to a function to another function i.e. by writing the name of the function after what seems to be the declaration of the function?
help with passing a pointer to a function to another function
Started by csepraveenkumar, Mar 20 2011 03:56 AM
1 reply to this topic
#1
Posted 20 March 2011 - 03:56 AM
how is the pointer to a particular function passed in the following code
|
|
|
#2
Posted 20 March 2011 - 05:16 AM
csepraveenkumar said:
how is the pointer to a particular function passed in the following code
qsort((void **)lineptr,0,nlines-1,[B][I](int(*)(void*,void*))(numeric?numcmp:strcmp)[/I][/B]);is it the normal way to pass a pointer to a function to another function i.e. by writing the name of the function after what seems to be the declaration of the function?
Seriously I don't get what you are trying to do here.But...
Definition of qsort:
void qsort( void** , int , int , int(*funptr)(void* , void*) );
Calling it:
qsort( , , , func1); //if func is the function you wanna call ; remember it should match with the prototype of your declaration of function pointer in definition
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









