Why can't we specify a variable size when declaring a static array? <p>Through dynamic memory allocation, the following the code works perfectly. </p> <pre><code>int *ptr; int size1; cin &gt;&gt; size1; ptr = new int[size1]; </code></pre> <p>In static memory allocation, I get the following error: array bound is not an integer constant before ']' token</p> <pre><code>int size2; cin &gt;&gt; size2; int arr[size2]; </code></pre> <p>Why is this so? Why can't we specify a variable size? </p>