title: How to cast a std::stringbuf into an array of char?
body: <p>What I'm trying to do here is to cast a <code>stringbuf</code> object into an array of char.</p>
  
  <p>I do this to send the array of char to a <code>C</code> interface which doesn't understand the type <code>std::stringbuf</code>.</p>
  
  <p>Here's a part of my code to illustrate the problem :</p>
  
  <pre><code>std::stringbuf buffer;
  char * data;
  
  //here i fill my buffer with an object
  buffer &gt;&gt; Myobject;
  //here is the function I want to create but I don't know if it's possible
  data = convertToCharArray(buffer);
  //here I send my buffer of char to my C interface
  sendToCInterface(data);
  </code></pre>