Freeze dynamic buffer and return pointer to it
#include <strstream> #include <iostream> using namespace std; main() { char *p; ostrstream outs; outs << "I like C++ "; outs.setf(ios::showbase); outs << 100 << ends; p = outs.str(); cout << p; delete p; return 0; }