Character Lookup function strchr
Char *mystrchr (const char *STR, const char c) {char *p = null;for (char*newp = str; *NEWP! = ' + '; newp++) {if (*newp==c) {p = newp;//A one-find break;}} return p;} Char *MYSTRCHRDG (const char *STR, const char c) {if (*str!= '} ') {return NULL;} Else{if (*str==c) {return str;//returns pointer}mystrchrdg (++STR, c);//loop area terminates}}//mystrchrvoid main () {char *pstr1 = MYSTRCHR ("Zrf Is Rocket ", ' Z '); char *pstr2 = <span style=" font-family:arial, Helvetica, Sans-serif; " >mystrchrdg</span> ("ZRF is Rocket", ' A ');p rintf ("pstr2=%s\n", PSTR2); if (pstr1 = = NULL) {printf ("Can not find") ;} else{printf ("Can find %p exists this character:%c\n", PSTR1, *PSTR1);} System ("Pause");}
Copyright NOTICE: This article is for bloggers original article, welcome to point out the code is bad, and put forward the Code optimization scheme. Welcome guidance, Night code, desperately struggling to update in ...
system function C string implementation (one-by-one): STRCHR