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 FunctionsSTRRCHR, STRRICHRSynopsis#include char * strrchr (char * s, int c)char * strrichr (char * s, int c)DescriptionThe strrchr() function is similar to the strchr() function, but searches from the end of the stringrather than the beginning, i.e. it locates the last occurrence of the character c in the null terminatedstring s. If successful it returns a pointer to that occurrence, otherwise it returns NULL.The strrichr() function is the case-insensitive version of this function.Example#include #include voidmain (void){char * str = "This is a string.";}while(str != NULL) {printf( "%s\n", str );str = strrchr( str+1, ’s’);}See Alsostrchr(), strlen(), strcmp(), strcpy(), strcat()Return ValueA pointer to the character, or NULL if none is found.214

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

Saved successfully!

Ooh no, something went wrong!