11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Library FunctionsQSORTSynopsis#include void qsort (void * base, size_t nel, size_t width,int (*func)(const void *, const void *))DescriptionThe qsort() function is an implementation of the quicksort algorithm. It sorts an array of nel items,each of length width bytes, located contiguously in memory at base. The argument func is a pointerto a function used by qsort() to compare items. It calls func with pointers to two items to be compared.If the first item is considered to be greater than, equal to or less than the second then funcshould return a value greater than zero, equal to zero or less than zero respectively.Example#include #include int aray[] = {567, 23, 456, 1024, 17, 567, 66};intsortem (const void * p1, const void * p2){return *(int *)p1 - *(int *)p2;}voidmain (void){register int i;183

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!