fork download
  1. # include <stdio.h>
  2.  
  3. void myStrcat(char s[], char t[]){
  4. int i;
  5. int j;
  6. for(i = 0; s[i] == '\0'; i++);
  7.  
  8. for(j = 0; t[j] == '\0'; j++){
  9. s[j + i] = t[j];
  10. }
  11.  
  12. s[j] = '\0';
  13.  
  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 ->