Recreate the strstr() function
问题 Hello i am trying to make my own strstr() function and i can't figure out why it is returning a segmentation fault.I am trying to search a string within another string and then return a pointer to the first 'same' letter. Any help would be appreciated. This is my code: char* ms_search(char *Str1,char* Str2){ char* p = NULL; int i,k=0,j = 0; for(i = 0;i < ms_length(Str1); i++){ if(Str1[i] == Str2[k]){ if(k == 0){ p = &Str1[i]; j= i; } if(k == ms_length(Str2)){ break; } k++; } else{ if(Str1[i]