Set size of char[] via int variable
<p>I've done quite a bit of research on how to set an arrays size using a variable of datatype <code>int</code>, but haven't been able to find anything of use.</p>

<p>So here is an example of what I've tried in which gives me an error saying <code>"expression must have a const value"</code></p>

<pre><code>char * charptr = "test";
int sze = strlen(charptr);
char str[sze];
</code></pre>

<p>Sorry if this question is idiotic, I'm still quite new to <code>c++</code></p>

<p>Any help will be appreciated though!</p>