Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. char * delChar(char * s, char q)
  2. {
  3. for(char * c = s; *c; ++c)
  4. {
  5. while(*c == q)
  6. memmove(c,c+1,strlen(c)+1);
  7. if (*c == 0) break;
  8. }
  9. return s;
  10. }
  11.  
  12. int main(int argc, const char * argv[])
  13. {
  14. char s[] = "Hello, Dolly!";
  15. printf("%sn",s);
  16. printf("%sn",delChar(s,'o'));
  17. printf("%sn",delChar(s,'!'));
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement