fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void myf(char *s1, char *s2)
  5. {
  6. char *p=s1;
  7.  
  8. p=strstr(s1,s2);
  9. if( p!=NULL ) {
  10. strcpy(p,p+strlen(s2));
  11. myf( p+1, s2 );
  12. }
  13.  
  14. }
  15.  
  16. int main(void)
  17. {
  18. char s1[]="ABCDEFGABCDEFGABCD";
  19. char s0[]="BCD";
  20.  
  21. myf(s1,s0);
  22. printf("%s\n",s1);
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
AEFGAEFGA