Good morning all,
Is it safe to use use strstream. I just googled it, and most of them are saying to use stringstream. But unfortunately my environment is not supporting sstream.
Basically I am doing the following stuff in my code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
char buffer[256];
strstream stream;
[code]for(count = 0; count < 30; ++count)
{
// how can i avoid this sprintf, format in the stream object itself
sprint(buffer, "%3d", count);
stream << buffer << ' ' << ' ';
}
// Send it to the terminal for printing, i need char* here
terminal << stream.str() // they are telling here it causes the memory leak
// now i want to clear stream, stream.clear() not works