SHARE
TWEET

Untitled

a guest Dec 19th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. char *fillChar(char str[], char sym[], int length) {
  2.     char *ptrStr = str;
  3.     char *ptrSym = sym;
  4.  
  5.     for (int i = 0; i < length; i++) {
  6.         if (*(ptrStr + i) == ptrSym) {
  7.             str[i] = str[i + 1];
  8.         }
  9.     }
  10.     return ptrStr;
  11. }
  12.    
  13. char *removeSym(char str[], char sym, int length) {
  14.   for (int i = 0; i < length; i++) {
  15.     if (str[i] == sym) {
  16.       for (int j = i + 1; j < length; j++) {
  17.         str[j - 1] = str[j];
  18.       }
  19.       str[length - 1] = '';
  20.       length--;
  21.       i--;
  22.     }
  23.   }
  24.  
  25.   return str;
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top