fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void foo(void *p)
  5. {
  6. int *arr = static_cast<int*>(p);
  7. std::cout << arr[0] << std::endl;
  8. }
  9.  
  10. int main()
  11. {
  12. int *V = new int[2];
  13. V[0] = 42;
  14. foo(V);
  15. return 0;
  16. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
42