This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to use a function as an argument in a function?


In C (or C++) I need to transfer a function name to another function, like

double fun(double x){
return x;
}

double calc(double FF(double x)){
 return a=fun(1.0);
}

print (calc(fun));

How can I do it?

With regards
Daniel







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]