title: Expression does not evaluate to constant
body: <p>I have the following stupid snippet:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  using namespace std;
  
  int main() {
      const string classpath = "Hello Dolly!";
      const int len = classpath.length()+1;
      char str[len];
      strncpy(str, classpath.c_str(), len);
      cout &lt;&lt; str &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>The aim ist to assign a c++ string to a c char array. The string is known at compile time, hence a constant. But the string may vary from one project to an other. I have no intention to count chars for the compiler. Hence the const len should be computed at compile time as shown. This works with cygwin and on linux. But the visualstudio compiler sees a problem and gives me the error C2131!
  How to work around? 
  (Please consider I'm a Java programmer being troubled loosing time on such kind of problems!)</p>