title: c++ issue with the TextOut() gdi function LPCSTR parameter
body: <p>I am trying to use the TextOut function to paint words on my window, and the following method works fine for me:</p>
  
  <pre><code>HDC hdc = GetDC(windowHandle);
  TextOut(hdc, 10, 10, TEXT("Hello World"), 16);
  ReleaseDC(windowHandle, hdc);
  </code></pre>
  
  <p>And this outputs :Hello World</p>
  
  <p>All good so far, however when I do the following method:</p>
  
  <pre><code>HDC hdc = GetDC(windowHandle);
  string myString = "Hello World";
  TextOut(hdc, 10, 10, myString.c_str(), 16);
  ReleaseDC(windowHandle, hdc);
  </code></pre>
  
  <p>the program outputs: Hello World#$%^&amp;</p>
  
  <p>and the #$%^&amp; part are actually other square symbols that I am not sure how to write on the keyboard. I understand that the forth parameter of the TextOut function is type LPCSTR, and using the .c_str() function after my string should output the LPCSTR variable correctly, and so it does since the program runs, however why do I get teh #$%^&amp; included at the end of Hello World and how might I go about fixing that issue? I do need to use the second method and not the first because my program will generate strings which then I would like to output to my window.</p>