Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. char *deleteWord(char *line, char *word)}{
  2.     int wordSize, i = 0, found, count;
  3.     char *p;
  4.    
  5.     int w = 0;
  6.     for (i; line[i] != '\0'; i++){
  7.         if (line[i]==word[w]){
  8.             if (count==0){found = i;}
  9.             w++;
  10.             count++;
  11.             if (word[w]=='\0'){
  12.  
  13.                 strcpy(line[found], line[i+1]);
  14.                 i = found-1;
  15.             }  
  16.         }
  17.         else{
  18.             count = 0;
  19.             w = 0;
  20.         }      
  21.     }
  22.     return line;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement