title: Use fprintf to memory stream
body: <p>I have a vc++ method that uses fprintf to write values to a file in the hard disc. I want to change this method so that instead of writing the values to disc, I want to return a pointer to the data.</p>
  
  <p>I know in advance the size I have to allocate. Is  there any way to pass a memory stream or unsigned char pointer to fprintf?</p>
  
  <p>thanks</p>