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