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