Why can't I use a function call to declare the length of an array?
<p>This is what I am trying to do:</p>

<pre><code>const char wav_folder[] = ".\\wav";
const char search_path[strlen(wav_folder) + 6];
</code></pre>

<p>but the strlen part is not allowing me to create this character array. This is not compiling. Why?</p>

<p>Errors:</p>

<pre><code>Error   1   error C2057: expected constant expression   c:\users\hassan\documents\cpp\dir_search\dir_search\dir_search\source.cpp   15  1   dir_search
Error   2   error C2466: cannot allocate an array of constant size 0    c:\users\hassan\documents\cpp\dir_search\dir_search\dir_search\source.cpp   15  1   dir_search
Error   3   error C2734: 'search_path' : const object must be initialized if not extern c:\users\hassan\documents\cpp\dir_search\dir_search\dir_search\source.cpp   15  1   dir_search
Error   4   error C2133: 'search_path' : unknown size   c:\users\hassan\documents\cpp\dir_search\dir_search\dir_search\source.cpp   15  1   dir_search
</code></pre>