SHARE
TWEET

Simple code

a guest Oct 26th, 2012 82 Never
  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. }
RAW Paste Data
Top