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

前端 未结 3 1903
北荒
北荒 2020-12-28 11:40

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

I would say char but I haven\

3条回答
  •  萌比男神i
    2020-12-28 12:27

    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 declares objects that associate objects with the standard C streams provided for by the functions declared in (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 .

    [...]

提交回复
热议问题