Penguin
Diff: CastingPointerToFunction
EditPageHistoryDiffInfoLikePages

Differences between version 7 and revision by previous author of CastingPointerToFunction.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 7 Last edited on Wednesday, July 16, 2003 3:42:52 pm by JohnMcPherson Revert
Older page: version 6 Last edited on Wednesday, July 16, 2003 2:17:23 pm by JosephPawletko Revert
@@ -27,9 +27,9 @@
 * Jon was using it to "compile" something then jump to it in C, by casting an array as a function, then calling it. 
  
 * I use it frequently to do things like have a lookup table of name to function. For example in ircu, there is a function called "parse" which takes a line from a user, splits it up into a function and it's arguments, then scans through a table of functions and their names, when it finds one that matches that command, it calls the function with the arguments it parsed earlier. Nice 'n zippy. 
  
-* Some functions take another function as an argument. See the example below. 
+* Some functions take another function as an argument. Probably the most well-known example is qsort(3) the quick sort algorithm -- you need to pass it an array and a function for comparing array elements. Also see the example below. 
  
  
 from atexit(1): 
  #include <stdlib.h>