Top "Iostream" questions

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

std::vector : cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&'

I encountered a confusing error message when trying to do something as simple as std::cout << std::vector&…

c++ gcc c++11 stl iostream
<iostream> vs. <iostream.h> vs. "iostream.h"

When including a header file in C++, what's the difference between... 1) including the .h versus not including the .h when …

c++ iostream
How do I deal with the max macro in windows.h colliding with max in std?

So I was trying to get valid integer input from cin, and used an answer to this question. It recommended: #…

c++ iostream cin
How to easily make std::cout thread-safe?

I have a multi-threaded application, which heavily uses std::cout for logging without any locking. In such a case, how …

c++ multithreading logging locking iostream
c++ multiple definitions of operator<<

I am attempting to override the << operator for a class. The purpose is basically to implement a toString() …

c++ overriding iostream operator-keyword
How to get IOStream to perform better?

Most C++ users that learned C prefer to use the printf / scanf family of functions even when they're coding in …

c++ optimization iostream c++-faq c++-standard-library
Prevent scientific notation in ostream when using << with double

I need to prevent my double to print in scientific notation in my file, when I do this outfile <&…

c++ iostream scientific-notation
How to read formatted data in C++?

I have formatted data like the following: Words 5 AnotherWord 4 SomeWord 6 It's in a text file and I'm using ifstream to …

c++ string iostream ifstream string-parsing
Loading a file into a vector<char>

I would like to load the contents of a text file into a vector<char> (or into any …

c++ iostream
Are int8_t and uint8_t intended to be char types?

Given this C++11 program, should I expect to see a number or a letter? Or not make expectations? #include <…

c++ c++11 iostream language-lawyer standard-library