fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void copy(const int* a, int* b, int size =5)
  6. {
  7. for ( int i=0; i<size; i++)
  8. {
  9. b[i] = a[i];
  10. }
  11. }
  12.  
  13. int main()
  14. {
  15. int a[] = {1,2,3,4,5};
  16.  
  17. int b[5];
  18.  
  19. ::copy(a,b,5);
  20.  
  21. cout << b << endl;
  22. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
0xbfcd541c