title: Use strcpy to transform a C++ string to a Char array
body: <p>For some reason, I was trying to covert a C++ string to a char array. Below is what I did:</p>
  
  <pre><code>string aS="hello world";
  char aC[aS.size()];
  strcpy(aC, aS.c_str());
  cout &lt;&lt; aC[0] &lt;&lt; endl;
  
  string bS="veooci  m eode owtwolwwwwtwwj mooawee mdeeme  eeeec eme aemmeledmll llllleolclclcmslococecewaccocmelaeaccoaaooojutmjooooocoemoooealm omjcdmcmkemmdemmmiwecmcmteeeote eoeeeem   ecc e  yolc e w    dtoooojttttmtwtt ttjcttoowl otdooco ko mooooo  aowmemm o  et  jmc    cmlctmmcccjcccecomatocooccoeoclooomoecwooo mcdoo dcdco dddooedoemod eddeedoedje  emadleweemeeedeeeec   or o  m  wejeetoj    o ojjjlwdjjjj mjmceaeoaai laaadoaa aetmotaemmj  mmmmmmlmm cmol c  mwoaoe omav";
  
  char bC[bS.size()];
  strcpy(bC, bS.c_str());
  cout &lt;&lt; aC[0] &lt;&lt; endl;
  </code></pre>
  
  <p>When aC[0] was first called, it gave 'h' as expected. However, when aC[0] is called at the second time, it gave ''. Could someone explain me what happened here? </p>