From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/FUNCTIONS/qsort.html | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 reference/C/FUNCTIONS/qsort.html (limited to 'reference/C/FUNCTIONS/qsort.html') diff --git a/reference/C/FUNCTIONS/qsort.html b/reference/C/FUNCTIONS/qsort.html new file mode 100644 index 0000000..466cd4e --- /dev/null +++ b/reference/C/FUNCTIONS/qsort.html @@ -0,0 +1,100 @@ +qsort function + + + + + + +
+
+

qsort function

+
+
+

+qsort will sort an array of elements. This is a wild function that +uses a pointer to another function that performs +the required comparisons. + +

+Library:   stdlib.h
+
+Prototype: void qsort(void *base, 
+		      size_t num, 
+		      size_t size, 
+ 		      int (*comp_func)(const void *, const void *))
+
+
+
+

Some explanation.

+ + + +
+

Notes

+
    +
  1. Well... This caused me alot of trouble! Although the prototype above is +exactly as shown in the documentation, the last parm kept giving compiler +warnings (invalid pointer type) this is the fix. +
    +	
    +Prototype: void qsort(void *base, 
    +		      size_t num, 
    +		      size_t size, 
    + 		      (void *) (*comp_func)(const void *, const void *))
    +
    +does anyone know the answer to this problem?? +

    +

  2. I think void * needs an explanation. +

    +

  3. And cast aswell +

    +

+
+ + +Example program 1 As basic as I can make it.

+ + +Example program with user input.

+ + +O'Reilly 'Using C' example.

+ + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + -- cgit v1.2.3-54-g00ecf