Advertisement
dllbridge

Untitled

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