title: Converting double to char* in C++ with high performance
body: <p>My application needs to convert double values to char* to write to a pipe that accepts only characters. The usual ways of doing this are using the <em>sprintf()</em> function or using <em>ostringstream</em> from iomanip.h header file.</p>
  
  <p>Turns out, both of these have really bad performance. And my application needs to do this conversion so often that it becomes the primary bottleneck.</p>
  
  <p>Is there any other function I could use? What logic can I use to write an efficient conversion function? The only thing I have managed to come up with so far is to get each individual digit out using division and mod operations, and append these digits to a char* to get the entire double value. This doesn't seem like a good approach though, and will likely have bad performance itself.</p>
  
  <p>Thanks in advance for your thoughts.</p>
  
  <p>EDIT: There is some confusion over how the char* will be used. The char* will be an argument to the fwrite function which writes to a pipe.</p>