title: Professors example of `new` in C++ will not work on my machine
body: <p>This is the professor's code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using std::cout;
  using std::cin;
  using std::endl;
  
  #include&lt;string&gt;
  #include &lt;new&gt;
  
  int main()
  {
      char *p;
      int index = 8;
  
      cout &lt;&lt; "Input how many characters:";
      cin &gt;&gt; index;
  
      p = new char [index + 1];
      cin &gt;&gt; p;
      cout &lt;&lt; "p is: " &lt;&lt; p;
      delete [] p;
      p = NULL;
      return 0;
  }
  </code></pre>
  
  <p>After I <strong>ANSWER</strong> "how many characters" statement <strong>with a number</strong> the program stops.  </p>
  
  <p>Anyone knows why?</p>