fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. #define SIZE1 5
  5. #define SIZE2 10
  6. #define SIZE3 15
  7.  
  8. int main(void){
  9. char a[SIZE1] = "Hello";
  10. char b[SIZE2] = " World";
  11. char res[SIZE3] = {0};
  12.  
  13. for (int i=0 ; i<SIZE1 ; i++){
  14. res[i] = a[i];
  15. }
  16.  
  17. strcat(res, b);
  18. printf("The new string is: %s\n",res);
  19. return 0;
  20. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
The new string is:  Hello World