fork download
  1. # include <stdio.h>
  2.  
  3. void myStrcat(char s[], char t[]){
  4. int i;
  5. for (i = 0; s[i] != '\0'; i++)
  6. ;
  7.  
  8. int j;
  9. for (j = 0; t[j] != '\0'; j++)
  10. {
  11. s[i + j] = t[j];
  12. }
  13. s[i + j] = '\0';
  14. return 0;
  15. }
  16.  
  17. int main(){
  18. char s[100];
  19. char t[100];
  20. scanf("%s %s",s,t);
  21. printf("%s + %s",s,t);
  22. myStrcat(s,t);
  23. printf(" -> %s\n",s);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5276KB
stdin
abc def
stdout
abc + def -> abcdef