Top "Iostream" questions

The C++ iostream library is an object-oriented library that provides input and output functionality using streams.

Reading and writing to the same file using the same fstream

I have a file that already contains some data (say, 8 kB). I want to read something from the beginning of …

c++ visual-studio-2012 iostream fstream
How can I set the decimal separator to be a comma?

I would like to read and write pi as 3,141592 instead of 3.141592, as using the comma is common in many European …

c++ formatting iostream comma decimal-point
Why are C++ STL iostreams not "exception friendly"?

I'm used to the Delphi VCL Framework, where TStreams throw exceptions on errors (e.g file not found, disk full). …

c++ exception stl iostream
Printing double without losing precision

How do you print a double to a stream so that when it is read in you don't lose precision? …

c++ floating-point iostream
Printing zero-padded hex with std::cout

Say I have a dword I want to output in hex with std::cout and left-pad with zeros, so 0xabcd …

c++ printf iostream cout
Why the constructor of std::ostream is protected?

Why I can't just create an "empty" stream for my output like this std::ostream out; ? This rows is apparently …

c++ iostream ostream
What is the <iosfwd> header?

What's the <iosfwd> header used for? Why is it necessary? Any example?

c++ iostream forward-declaration iosfwd
stdio vs iostream

When I search on the internet for the difference between these two libraries, everyone says that <iostream> is …

c++ io iostream stdio
Using std::ostream as argument to a print function

I have always used cout to print the statement but now I want learn printing by passing the stream, something …

c++ iostream ostream
'std::ios_base::ios_base(const std::ios_base&)’ is private' error while overloading operator<< for std::ostram

I've got a struct which looks like this: sturct person { string surname; person(string n) : surname(n) {}; } I need to …

c++ iostream ostream