1. Provide a flag as an argument to the function, but this is not
flexible because
the function can only perform a fixed set of comparison (ascending
and descending).
2. The much nicer way is to let the caller pass a function to the
function
For details, please see the following:
http://www.cprogramming.com/tutorial/function-pointers.html
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment