title: How to solve C6386 warning?
body: <p>I'm writing a simple code to read systemized data from .txt file, and got warning "C6386: Buffer overrun while writing to 'points': the writable size is 'num*8' bytes, but '16' bytes might be written". How to solve it in my case ? Code attached.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>struct point {
      int x, y;
  };
  
  void main()
  {
      fstream file;
      point* points;
      int num, 
          i = 0;
  
      file.open("C:\\Users\\Den\\Desktop\\file.txt", fstream::in);
      if (!file.is_open()) {
          cout &lt;&lt; "No file found\n";
          exit(1);
      }
      else {
          file &gt;&gt; num;
          points = new point[num];
      }
  
      while (file &gt;&gt; num) {
          points[i].x = num;   // &lt;- here
          file &gt;&gt; num;
          points[i].y = num;
          i++;
      }
  
      file.close();
  }
  </code></pre>