Want more features on Pastebin? Sign Up, it's FREE!
Guest

Simple code

By: a guest on Oct 26th, 2012  |  syntax: C  |  size: 0.47 KB  |  views: 81  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. extern void subs (char *string, char this_c, char that_c) ;
  5.  
  6. int main (int argc, char *argv[])
  7. {
  8.         char this_c = 'e';
  9.         char that_c = 'X';
  10.         char orgstr[] = "sir sid easily teases sea sick seals";
  11.        
  12.         for (i:orgstr)
  13.         {
  14.         if(i == this_c)
  15.                 {
  16.                 i = that_c;
  17.                 }
  18.         }
  19.         printf("Changed string: %s\n", orgstr);
  20.         exit(0);
  21. }
clone this paste RAW Paste Data