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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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!