字符串的基本操作,c语言实现 话不多说,直接上代码。如果有什么错误,直接喷! #include <stdio.h> #include <stdlib.h> #define LEN 100 #define LENINC 10 int main() { char string[LEN] ; char string1[] = {"asdfghjkl"}; char string2[] = {"asdfghjkl"}; printf("\nlength=%d\n",...
字符在字符串中第一次出现的index intmyindexof(constchar*str,constchar*chr){if(!str || !chr ){return-1; }constchar*pstr =str;constchar*pchr =chr;chartmpc ='\0';while((tmpc = *pstr++) != *pchr &&tmpc) ;if(!tmpc){return-1; }else{return(--pstr -str); } } 字符串在字符串...