Metrick

Untitled

Jun 12th, 2011
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <string.h>
  2.  
  3. ...
  4.  
  5. char *Copy(char *source, int a, int b)
  6. {
  7.   int j=0;
  8.   char res = new char[strlen(source)];
  9.   for (int i=a; i<=b; i++)
  10.   {
  11.     res[j]=source[i];
  12.     j++;
  13.   }
  14.   res[j]="\0";
  15.   return(res);
  16. }
  17.  
  18. ...
  19.  
  20. int Pos(char *source, char symbol);
  21. {
  22.   return -1;
  23.   for (int i=0; i<strlen(source); i++)
  24.   {
  25.     if (source[i]=symbol)
  26.     {
  27.       return i;
  28.       break;
  29.     }
  30.   }
  31. }
  32.  
  33. ...
Advertisement
Add Comment
Please, Sign In to add comment