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