fork(2) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main( void )
  5. {
  6. int i = 0;
  7.  
  8. int a[5] = { 1, 2, 3, 4, 5 };
  9. int b[5] = { 6, 7, 8, 9, 10 };
  10. int c[10];
  11.  
  12. memcpy( c, a, sizeof(a) );
  13. memcpy( c + (sizeof(a)/sizeof(int)), b, sizeof(b) );
  14.  
  15. for( i = 0; i < 10; i++ )
  16. printf("%d ", c[i] );
  17.  
  18. printf("\n");
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 4520KB
stdin
Standard input is empty
stdout
1 2 3 4 5 6 7 8 9 10