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 FunctionsMEMCHRSynopsis#include void * memchr (const void * block, int val, size_t length)DescriptionThe memchr() function is similar to strchr() except that instead of searching null terminated strings,it searches a block of memory specified by length for a particular byte. Its arguments are a pointerto the memory to be searched, the value of the byte to be searched for, and the length of the block.A pointer to the first occurrence of that byte in the block is returned.Example#include #include unsigned int ary[] = {1, 5, 0x6789, 0x23};voidmain (void){char * cp;}cp = memchr(ary, 0x89, sizeof ary);if(!cp)printf("not found\n");elseprintf("Found at offset %u\n", cp - (char *)ary);See Alsostrchr()165

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

Saved successfully!

Ooh no, something went wrong!