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