Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char* MyStrstr(char* pszSearchString, char* pszSearchWord);
- int main(int argc, char* argv[])
- {
- char szTemp1[20] = {0};
- char szTemp2[10] = {0};
- char * pszTemp1 = NULL;
- strcpy(szTemp1, "aabaaacaamaad");
- strcpy(szTemp2, "aa");
- pszTemp1 = MyStrstr(szTemp1, szTemp2);
- printf("%s", pszTemp1);
- getch();
- return 0;
- }
- char* MyStrstr(char* pszSearchString, char* pszSearchWord)
- {
- int nFcount = 0;
- int nScount = 0;
- int nSearchLen = 0;
- int nIndex = 0;
- char* pszDelString = NULL;
- if(pszSearchString == NULL || pszSearchWord == NULL) {
- return NULL;
- }
- while(pszSearchWord[nSearchLen] != '