Advertisement
Guest User

memory corruption

a guest
Jul 23rd, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1.         void removeNonLetters(char* phrase) {
  2.             int ascii = 0;
  3.             int i = 0;
  4.             while (*(phrase+i+1) != '\0') {
  5.                 i++;
  6.                 ascii = (int)*(phrase+i);
  7.                 if (!((ascii > 64 && ascii < 91) || (ascii > 96 && ascii < 123))) {
  8.                     int j = i;
  9.                     i --;
  10.                     while (*(phrase+j) != '\0') {
  11.                         j++;
  12.                         *(phrase+j-1) = *(phrase+j);
  13.                     }
  14.                 }
  15.             }
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement