Top "Ostream" questions

In C++ std::ostream is the base class for output streams.

How to properly overload the << operator for an ostream?

I am writing a small matrix library in C++ for matrix operations. However my compiler complains, where before it did …

c++ namespaces operator-overloading iostream ostream
how do I print an unsigned char as hex in c++ using ostream?

I want to work with unsigned 8-bit variables in C++. Either unsigned char or uint8_t do the trick as …

c++ formatting ostream
How to make C++ cout not use scientific notation

double x = 1500; for(int k = 0; k<10 ; k++){ double t = 0; for(int i=0; i<12; i++){ t += x * 0.0675; x += x * 0.0675; } …

c++ double cout ostream scientific-notation
Floating point format for std::ostream

How do I do the following with std::cout? double my_double = 42.0; char str[12]; printf_s("%11.6lf", my_double); // Prints " 42.000000" …

c++ floating-point cout ostream
How to use C++ std::ostream with printf-like formatting?

I am learning C++. cout is an instance of std::ostream class. How can I print a formatted string with …

c++ formatting printf ostream
overloading friend operator<< for template class

I have read couple of the questions regarding my problem on StackOverflow.com now, and none of it seems to …

c++ templates operator-overloading friend ostream
Reading getline from cin into a stringstream (C++)

So I'm trying to read input like this from the standard input (using cin): Adam English 85 Charlie Math 76 Erica History 82 …

c++ cin getline stringstream ostream
Create a print function that takes an ostream as an argument and writes to that stream

Im currently anwsering exercise questions concerning operator overloading in C++. I have a question: Create a simple class containing an …

c++ operator-overloading ostream
C++ Passing ostream as parameter

I'm working on a homework project for a virtual rolodex that has called for a main class, a rolodex class, …

c++ parameter-passing ostream
Function that prints something to std::ostream and returns std::ostream?

I want to write a function that outputs something to a ostream that's passed in, and return the stream, like …

c++ outputstream ostream