fork(1) download
  1. #include <iostream>
  2.  
  3. int main() {
  4. int *a = new int[5] {1, 0, 2, 0, 3};
  5. int (&b)[5] = *reinterpret_cast<int(*)[5]>(a);
  6. b[2] = 5;
  7. for (int i = 0; i < 5; ++i)
  8. std::cout << a[i] << ' ';
  9. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
1 0 5 0 3