What does β€œc” mean in cout, cin, cerr and clog?

What does β€œc” mean in the names cout, cin, cerr and clog?

I would say char , but I did not find anything to confirm it.

+43
c ++ iostream standard-library
Feb 14 '10 at 18:29
source share
4 answers

"c" means "character" because iostreams displays values ​​in views and from bytes (char). [ Frequently asked questions about the style and technique of Bjarne Stroustrup C ++ ]

+62
Feb 14 2018-10-14
source share

Initially, I assumed the console , but this link confirmed this. But, seeing a quote from Stroustrup , it seems that this is a fallacy, and that c means a symbol .

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

+24
Feb 14 '10 at 18:30
source share

'C' means console

+1
Feb 14 '10 at 18:46
source share

Edit: FredOverflow found the correct answer with a link to the Stroustrup website.

The standard C ++ draft (n1905.pdf at www.open-std.org, I have no exact link) seems to indicate that it comes from "C": "C standard output" => cout

27.3 Standard iostream objects [lib.iostream.objects]

1- The <iostream> header declares objects that connect objects with standard C streams provided by the declared functions in <cstdio> (27,8,2).

[...]

27.3.1 Narrow stream objects [lib.narrow.stream.objects]

istream cin

1 - The cin object controls the entry from the stream buffer associated with the stdin object declared in <. Cstdio>

[...]

+1
Feb 14 '10 at 19:01
source share



All Articles