title: Pointer takes elements bigger than its size in c++
body: <p>When creating a pointer using new keyword or &lt;stdlib.h&gt;'s malloc, and put its size 0; what ever is the index number it doesnt give an error and works. ( i am not sure if this works if the size bigger then 0, because some times when i allocate a memory block and place an element outside its range program crashes).</p>
  <p>My question : is this a c++ thing? Or just from my compiler? Is it safe to use it for arrays i don't want to limit it with specific size. Because i am thinking to use this in my game to make unlimited world generation and save it ( Not all terrain just the breakable and placable objects)</p>
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
      
      int* x = new int[0];
      
      x[100] = 0;
      
      cout &lt;&lt; x[100];
      
      return 0;
  }
  </code></pre>