title: Printing std::string via printf() in Visual Studio
body: <pre><code>#include &lt;string&gt;
  #include &lt;cstdio&gt;
  int main() {
    std::string s = "12345678";
    std::printf("[%s]\n", s);
  }
  </code></pre>
  
  <p>Here is an obvious typo of missing ".c_str()". But VS2011 even with /Wall doesn't emit any warnings, and the program works. If to compile this code in gcc, it says "warning: cannot pass objects of non-POD type 'struct std::string' through '...'; call will abort at runtime" and the program crashes with "Illegal instruction".</p>
  
  <p>Did they really implement a trick in VS STL to make programs having such typo working just because this typo is very common?</p>
  
  <p><strong>UPDATE</strong>: The question is why it works in VS?</p>