Advertisement
dllbridge

Untitled

Jan 2nd, 2024
911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include   <stdio.h>
  5. #include  <string.h>    
  6.  
  7.  
  8. char sz1[123] = "SONY",
  9.      sz2[123] = " ONE, Two";
  10.        
  11.        
  12.        
  13. //////////////////////////////////////////////////////     
  14. void _strcpy(char *p1, char *p2)
  15. {
  16.      int n = strlen(p2);
  17.      
  18.      for(int i = 0; i < n; i++)
  19.      {
  20.        
  21.          sz1[i] = sz2[i];
  22.      }
  23.      sz1[n] = 0;
  24. }
  25.        
  26.        
  27.        
  28.        
  29.  
  30. //////////////////////////////////////////////////////
  31. int main()
  32. {
  33.    
  34.     _strcpy(sz1, sz2);
  35.  
  36.                
  37.     printf("%s \n", sz1);  
  38.  
  39. return 0;
  40. }
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement