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