What does the "c" mean in cout, cin, cerr and clog?

C++IostreamStandard Library

C++ Problem Overview


What does the "c" mean in the cout, cin, cerr and clog names?

I would say char but I haven't found anything to confirm it.

C++ Solutions


Solution 1 - C++

> The "c" stands for "character" because iostreams map values to and from byte (char) representations. [Bjarne Stroustrup's C++ Style and Technique FAQ]

Solution 2 - C++

I originally guessed console, and this link confirmed it. But after seeing the quote from Stroustrup, it seems that's a misconception, and that the c stands for character.

One thing in favor of that theory that can serve as an indicator is the fact that for each stream object (cin, cout, cerr, etc.) there is an equivalent, wide-stream one (wcin, wcout, wcerr, etc.).

Solution 3 - C++

Edit: FredOverflow has found the right answer with a link toward Stroustrup web site.

A c++ standard draft (n1905.pdf on www.open-std.org, I don't have the exact link) seems to indicate that it comes from "C" : "C standard output" => cout

> 27.3 Standard iostream objects [lib.iostream.objects] > > 1- The header <iostream> declares objects that associate > objects with the standard C streams > provided for by the functions declared > in <cstdio> (27.8.2). > > [...] > > > 27.3.1 Narrow stream objects [lib.narrow.stream.objects] > > istream cin > > 1- The object cin controls input from a stream buffer associated with > the object stdin, declared in > <cstdio>. > > [...]

Solution 4 - C++

The c stands for C, C++, and/or Character.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRexxarView Question on Stackoverflow
Solution 1 - C++fredoverflowView Answer on Stackoverflow
Solution 2 - C++JRLView Answer on Stackoverflow
Solution 3 - C++RexxarView Answer on Stackoverflow
Solution 4 - C++Java1View Answer on Stackoverflow