C/C++ Language Reference

C/C++ Language ReferenceThe C/C++ Language Reference describes the syntax, semantics, and IBM implementation of the C and C++ programming languages. Syntax and semantics constitute a complete specification of a programming language, but complete implementations can differ because of extensions. The IBM implementations of Standard C and Standard C++ attest to the organic nature of programming languages, reflecting pragmatic considerations and advances in programming techniques, which are factors that influence growth and change. The extensions in IBM C and C++ also reflect the changing needs of modern programming environments.

The aims of this reference are to provide a description of the Standard C and C++ languages outside of any historical context, and to promote a programming style that emphasizes portability. The expression Standard C is a generic term for the current formal definition of the C language, preprocessor, and run-time library. The same naming convention exists for C++. The expression Standard C is ambiguous because subsequent formal definitions of the language have appeared while implementations of its predecessors are still in use. To avoid possible ambiguity and confusion with K&R C, this reference uses the term ISO C to mean Standard C, and the term Classic C to refer to the C language plus the generally accepted extensions produced by Brian Kernighan and Dennis Ritchie (K&R C) that were in use prior to ISO C. The expression Standard C++ is unambiguous because there has been only one formal definition of the language.

Besides conforming to various language standards, this release contains language extensions that enhance the usability of the IBM C and C++ compilers and the portability of the programs developed with them.

An orthogonal extension is a feature that is added on top of a base without altering the behavior of the existing language features. A valid program conforming to a base level will continue to compile and run correctly with such extensions. The program will still be valid, and its behavior will remain unchanged in the presence of the orthogonal extensions. Invalid programs may behave differently at execution time and in the diagnostics issued by the compiler.

A function declaration establishes the name of the function and the number and types of its parameters. A function declaration consists of a return type, a name, and a parameter list. A declaration informs the compiler of the format and existence of a function prior to its use. A function can be declared several times in a program, provided that all the declarations are compatible. Implicit declaration of functions is not allowed: every function must be explicitly declared before it can be called. The compiler checks for mismatches between the parameters of a function call and those in the function declaration. The compiler also uses the declaration for argument type checking and argument conversions.

Website: www.nersc.gov | Filesize: 1791kb
No of Page(s): 406
Click here to download C/C++ Language Reference.

Related Tutorial

Tags: , , , , , , , ,

Comments

Leave a Reply