title: c++ create an array with string::size
body: <p>Im trying to create an array with the string::size member but its complaining at the declaration of "char message[msgSize]" that the expression did not evalute to a constant. </p>
  
  <p>However it alows me to declare "msgSize".</p>
  
  <p>How can this be? Why am i allowed to make a constant but i'm not allowed to use it to something that needs a const.</p>
  
  <p>If the answer is that: "the size of the string could change" then the same argument can be made for using sizeof(), but that works.</p>
  
  <pre><code>const unsigned int msgSize = 
          saveAs.size() +
          sizeof("NOTE|  sent get request to: ") + 10;
  
      char message[msgSize];
      memset(message, 0, msgSize);
      sprintf_s(message, msgSize,"NOTE| sent get request to: %s", saveAs.c_str());
      _cRec-&gt;output(message);
  </code></pre>