raise. McGraw-Hill The Complete Reference Fourth Edition
광고
광고
C h a p t e r 3 0 : U t i l i t y F u n c t i o n s
769
The qsort( ) function sorts the array pointed to by buf using a Quicksort (developed by C.A.R. Hoare). The Quicksort is the best general-purpose sorting algorithm. Upon termination, the array will be sorted. The number of elements in the array is specified by num, and the size (in bytes) of each element is described by size.
The function pointed to by compare is used to compare an element of the array with the key. The form of the compare function must be as follows: int func_name(const void *arg1, const void *arg2);
It must return values as described here:
Comparison
arg1 is less than arg2
arg1 is equal to arg2
arg1 is greater than arg2
Value Returned
Less than zero
Zero
Greater than zero
The array is sorted into ascending order with the lowest address containing the lowest element.
A related function is bsearch( ).
raise
#include <csignal> int raise(int signal);
The raise( ) function sends the signal specified by signal to the executing program.
It returns zero if successful, and nonzero otherwise. It uses the header <csignal>.
The following signals are defined by Standard C++. Of course, your compiler is free to provide additional signals.
Macro
SIGABRT
SIGFPE
SIGILL
Meaning
Termination error
Floating-point error
Bad instruction
다운로드
광고