Home > Back-end >  Strives for the big help
Strives for the big help

Time:12-17

求大佬指点一二

CodePudding user response:

Process function, with an f, m=f (x, y);
P, q do what?
According to the different function of the process incoming, f body perform different functions, so the p, q, it is not necessary to say with the p, q do both functions return values of purpose?


 
Void process (int x, int y, int (* f) (int, int))
{
Int w=f (x, y);
Printf (" % d \ n ", w);
}

This function performs a few statement is ok, try ~

CodePudding user response:

Printed things it is better to return values

 int process (int x, int y, int (* f) (int, int)) 
{
The return of f (x, y);
}

//the main change
Printf (" Max=% d ", the process (a, b, Max));
Printf (" \ nmin=% d ", the process (a, b, min));
Printf (" \ nadd bring them any closer=% d ", the process (a, b, add));
  • Related