document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <assert.h>
  4. using namespace std;
  5.  
  6. char *MyStrcpy(char *strDest, const char *strSrc);
  7.  
  8. int main()
  9. {
  10.         char s[] = "123456789";
  11.         char d[] = "123";
  12.         MyStrcpy(d,s);
  13.  
  14.         printf("s = %s \\n",d);
  15.          printf("d = %s \\n",s);
  16.  
  17.         system("pause");
  18.         return 0;
  19. }
  20.  
  21. char *MyStrcpy(char *strDest, const char *strSrc)
  22. {
  23.         assert((strDest!=NULL) && (strSrc!=NULL));
  24.         char *address = strDest;
  25.         while((*strDest++ = *strSrc++) != \'\\0\');
  26.         *strDest=\'\\0\';
  27.         return address;
  28. }
');