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 Functions}i = 0;while(gets(inbuf)) {sscanf(inbuf,"%s %d", values[i].name, &values[i].value);i++;}qsort(values, i, sizeof values[0], val_cmp);vp = bsearch("fred", values, i, sizeof values[0], val_cmp);if(!vp)printf("Item ’fred’ was not found\n");elseprintf("Item ’fred’ has value %d\n", vp->value);See Alsoqsort()Return ValueA pointer to the matched array element (if there is more than one matching element, any of thesemay be returned). If no match is found, a null pointer is returned.NoteThe comparison function must have the correct prototype.129

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

Saved successfully!

Ooh no, something went wrong!