Top "Stringstream" questions

stringstream provides an interface to manipulate strings as if they were input/output streams.

Turning temporary stringstream to c_str() in single statement

Consider the following function: void f(const char* str); Suppose I want to generate a string using stringstream and pass …

c++ string stringstream temporary
Why is stringstreams rdbuf() and str() giving me different output?

I have this code, int main() { std::string st; std::stringstream ss; ss<<"hej hej med dig"<&…

c++ std stringstream getline sstream
Could I use stringstream as a memory stream like `MemoryStream` in C#?

In C/C++, strings are NULL terminated. Could I use stringstream as a memory stream like MemoryStream in C#? Data …

c++ stringstream
redirect std::cout to a custom writer

I want to use this snippet from Mr-Edd's iostreams article to print std::clog somewhere. #include <iostream> #include &…

c++ stream stringstream iostream streambuf
Can I tell if a std::string represents a number using stringstream?

Apparently this is suposed to work in showing if a string is numerical, for example "12.5" == yes, "abc" == no. However I …

c++ numbers stringstream words
Using stringstream to input/output a bool value

this may seem like a stupid question but i am stumped. Here is my code: int main() { string line, command; …

c++ stringstream
How to force std::stringstream operator >> to read an entire string?

How to force std::stringstream operator >> to read an entire string instead of stopping at the first whitespace? …

c++ stl stringstream stdstring
The role of std::ws (whitespace) when reading data

Data saved in my file is (white spaces added at both beginning and end on purpose for this test): 1 2 3 Loading …

c++ whitespace getline stringstream istringstream
using stringstream to print a rounded floating point number

i have floating point variables "lmin" and "lmax". i wish to display only 4 significant digits. i am currently using something …

c++ string stringstream
C++ Piping ifstream into stringstream

I am overloading my istream operator, so I can replace std::cin with my object. I know I will have …

c++ file ifstream stringstream istringstream