Guest User

K&R Exercise 5.3

a guest
Sep 19th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void strcat1(char *, char *);
  4.  
  5. int main()
  6. {
  7.     char *s = "Pointer";
  8.     char *t = "Array";
  9.     strcat1(s,t);
  10.     printf("\n");
  11.     puts(s);
  12.     printf("\n");
  13.     return 0;
  14. }
  15.  
  16. void strcat1(char *s, char *t)
  17. {
  18.     while(*s++ != '\0')
  19.         ;
  20.     while(*s++ = *t++)
  21.         ;
  22. }
Add Comment
Please, Sign In to add comment