title: initializing a dynamic array to 0?
body: <pre><code>int main()
  {
      int arraySize;
      int arrayMain[arraySize-1];
      cout &lt;&lt; "\n\nEnter Total Number of Elements in Array.\n\n";
      cin &gt;&gt; arraySize;
      arrayMain[arraySize-1]={0};
      cout &lt;&lt;"\n\n" &lt;&lt;arrayMain;
      return 0;
  }
  </code></pre>
  
  <p>my compiler freezes when I compile the above code. I am confused on how to set a dynamic array to 0?</p>