Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

being pedantic

Status
Not open for further replies.

mastermagrath

Technical User
May 21, 2004
28
US
Hi,

Is it correct to say that the C++ language technically doesn't include for example cout and cin but rather these are functions written in the C++ language which have become a part of the standard C++ library???

I know its being pernickity but its bugging me!!

Cheers
 
Well if you are being pernickity, you are quite wrong. Both cout and cin are instances of classes, they are objects. cout is an object of class std::eek:stream which is itself a typedef of a template instantiation. The same goes for cin except that its an object of std::istream
 
It depends on what you mean by language.

The language standard requires cout and cin, so you could say they are part of the language, since the standard is the definition of the language and they are part of the standard.

However, one might also consider the language to be made up only of the rules, keywords, built-in types, etc. as opposed to everything covered by the standard. In that case you would say that the standard defines the language as well as required additions to the language like the standard C++ library.

In my opinion, either one could be considered correct depending on the context of the conversation. If I had to pick one, I'd say the second, primarily because of the following quote from section 1.5 of the standard, which differentiates between the two:
Clauses 2 through 16 describe the C + + programming language. That description includes detailed syntactic specifications in a form described in 1.6. For convenience, Annex A repeats all such syntactic specifications.

Clauses 17 through 27 (the library clauses) describe the Standard C + + library, which provides definitions for the following kinds of entities: macros (16.3), values (clause 3), types (8.1, 8.3), templates (clause 14), classes (clause 9), functions (8.3.5), and objects (clause 7).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top