Guest
Public paste!

ss

By: a guest | Mar 19th, 2010 | Syntax: None | Size: 0.59 KB | Hits: 77 | Expires: Never
Copy text to clipboard
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <string.h>
  4.  
  5.  
  6. char* remove(char *source,int position,int length)  {
  7.      
  8.       int j=0;
  9.       for (j=0;j<length;j++)  {
  10.           int i = position;
  11.           while (i<strlen(source)) {
  12.             source[i] = source[i+1];
  13.             i++;
  14.           }
  15.           source[strlen(source)] = '\0';
  16.       }
  17.       return source;
  18. }  
  19.  
  20. int main()   {
  21.     char myString[256];
  22.     int poz,length;
  23.    
  24.     scanf("%s",myString);
  25.    
  26.     remove(myString,3,3);
  27.    
  28.     printf("%s\n",myString);
  29.    
  30.     system("pause");
  31.     return 0;
  32. }