fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int *p = new int[10]{}; //notice the {}
  6. for(int *it = p; it != p+10; ++it)
  7. {
  8. std::cout << *it << std::endl;
  9. }
  10. delete[] p;
  11. }
  12.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
0
0
0
0
0
0
0
0
0
0