get the length of a string and assign it to an array : <p>Total c++ newbie here.</p>

<p>I have a problem, where I can not assign the number of character in a string to an array size, like so..😓</p>

<pre><code>string outStr;
ifstream input("read.txt");
getline(input, outStr);

int const n = outStr.length();
int arr[n];
</code></pre>

<p>error msg --> expression must have a constant value. although i have declared the "const"</p>

<p>Thanks in advance✌.</p>
