pass c_str return value of temporary object to printf
<p>Is the following piece of code valid?</p>

<blockquote>
  <p>class A { string m_name; <br>
  public:<br>
  string getName() { return m_name; } <br>
  }</p>
  
  <p>.....<br>
  printf("%s", object.getName().c_str()) <br>
  ......</p>
</blockquote>

<p>where object.getName() returns a temporary string object.</p>
