The following code fails to compile:
#include <cstdio>
#include <sstream>
int main()
{
std::ostrstream strm;
strm.rdbuf()->freeze(0);
}
I get the following errors on compilation:
g++ sample3.cpp
sample3.cpp: In function 'int main()':
sample3.cpp:5: error: 'ostrstream' is not a member of 'std'
sample3.cpp:5: error: expected `;' before 'strm'
sample3.cpp:6: error: 'strm' was not declared in this scope
After searching in google, I suspect that I should use ostringstream in place of ostrstream, so I have modified the program as below:
#include <cstdio>
#include <sstream>
int main()
{
std::ostringstream strm;
strm.rdbuf()->freeze(0);
}
But now I get the following errors:
g++ sample3.cpp
sample3.cpp: In function 'int main()':
sample3.cpp:6: error: 'struct std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >' has no member named 'freeze'