• Complain

Brian W Kernighan - The C Programming Language, Ansi C

Here you can read online Brian W Kernighan - The C Programming Language, Ansi C full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Upper Saddle River, NJ, year: 2011, publisher: Prentice-Hall PTR, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Brian W Kernighan The C Programming Language, Ansi C

The C Programming Language, Ansi C: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "The C Programming Language, Ansi C" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Brian W Kernighan: author's other books


Who wrote The C Programming Language, Ansi C? Find out the surname, the name of the author of the book and a list of all author's works by series.

The C Programming Language, Ansi C — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "The C Programming Language, Ansi C" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make


Appendix A - Reference Manual
A.1 Introduction
This manual describes the C language specified by the draft submitted to ANSIon 31 October, 1988, for approval as ``American Standard for InformationSystems - programming Language C, X3.159-1989.'' The manual is aninterpretation of the proposed standard, not the standard itself, althoughcare has been taken to make it a reliable guide to the language.

For the most part, this document follows the broad outline of the standard,which in turn follows that of the first edition of this book, although theorganization differs in detail. Except for renaming a few productions, andnot formalizing the definitions of the lexical tokens or the preprocessor,the grammar given here for the language proper is equivalent to that of thestandard.

Throughout this manual, commentary material is indented and written in smallertype, as this is. Most often these comments highlight ways in which ANSIStandard C differs from the language defined by the first edition of thisbook, or from refinements subsequently introduced in various compilers.
A.2 Lexical Conventions
A program consists of one or more translation units stored in files.It is translated in several phases, which are described in iscomplete, the program has been reduced to a sequence of tokens.
A.2.1 Tokens
There are six classes of tokens: identifiers, keywords, constants, stringliterals, operators, and other separators. Blanks, horizontal and verticaltabs, newlines, formfeeds and comments as described below (collectively,``white space'') are ignored except as they separate tokens. Some white spaceis required to separate otherwise adjacent identifiers, keywords, andconstants.

If the input stream has been separated into tokens up to a given character,the next token is the longest string of characters that could constitute atoken.

A.2.2 Comments
The characters /* introduce a comment, which terminates with thecharacters */ . Comments do not nest, and they do not occur within astring or character literals.
A.2.3 Identifiers
An identifier is a sequence of letters and digits. The first character mustbe a letter; the underscore _ counts as a letter. Upper and lowercase letters are different. Identifiers may have any length, and for internalidentifiers, at least the first 31 characters are significant; someimplementations may take more characters significant. Internal identifiersinclude preprocessor macro names and all other names that do not haveexternal linkage (). Identifiers with external linkage aremore restricted: implementations may make as few as the first six characterssignificant, and may ignore case distinctions.
A.2.4 Keywords
The following identifiers are reserved for the use as keywords, and may notbe used otherwise: auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static whileSome implementations also reserve the words fortran and asm . The keywords const , signed , and volatile are newwith the ANSI standard; enum and void are new since thefirst edition, but in common use; entry , formerly reserved but neverused, is no longer reserved.
A.2.5 Constants
There are several kinds of constants. Each has a data type; discusses the basic types:

constant:
integer-constant
character-constant
floating-constant
enumeration-constant

A.2.5.1 Integer Constants
An integer constant consisting of a sequence of digits is taken to be octalif it begins with 0 (digit zero), decimal otherwise. Octal constants do notcontain the digits or . A sequence of digits preceded by 0x or 0X (digit zero) is taken to be a hexadecimal integer. Thehexadecimal digits include a or A through f or F withvalues through .

An integer constant may be suffixed by the letter u or U , tospecify that it is unsigned. It may also be suffixed by the letter l or L to specify that it is long.

The type of an integer constant depends on its form, value and suffix. (See for a discussion of types). If it is unsuffixed anddecimal, it has the first of these types in which its value can berepresented: int , long int , unsigned long int . Ifit is unsuffixed, octal or hexadecimal, it has the first possible of thesetypes: int , unsigned int , long int , unsignedlong int . If it is suffixed by u or U , then unsigned int , unsigned long int . If it is suffixed by l or L , then long int , unsigned long int .If an integer constant is suffixed by UL , it is unsigned long .

The elaboration of the types of integer constants goes considerably beyondthe first edition, which merely caused large integer constants to be long . The U suffixes are new.
A.2.5.2 Character Constants
A character constant is a sequence of one or more characters enclosed insingle quotes as in 'x' . The value of a character constant with onlyone character is the numeric value of the character in the machine'scharacter set at execution time. The value of a multi-character constant isimplementation-defined.

Character constants do not contain the ' character or newlines; inorder to represent them, and certain other characters, the following escapesequences may be used:

newlineNL (LF)\nbackslash\\\
horizontal tabHT\tquestion mark?\?
vertical tabVT\vsingle quote'\'
backspaceBS\bdouble quote"\"
carriage returnCR\roctal numberooo\ooo
formfeedFF\fhex numberhh\xhh
audible alertBEL\a

The escape \ooo consists of the backslash followed by 1, 2,or 3 octal digits, which are taken to specify the value of the desiredcharacter. A common example of this construction is \0 (not followed by a digit), which specifies the character NUL. The escape \xhh consists of the backslash, followed by x , followedby hexadecimal digits, which are taken to specify the value of the desiredcharacter. There is no limit on the number of digits, but the behavior isundefined if the resulting character value exceeds that of the largestcharacter. For either octal or hexadecimal escape characters, if theimplementation treats the char type as signed, the value issign-extended as if cast to char type. If the character following the\ is not one of those specified, the behavior is undefined.

In some implementations, there is an extended set of characters that cannotbe represented in the char type. A constant in this extended set iswritten with a preceding L , for example L'x' , and is called awide character constant. Such a constant has type wchar_t , an integraltype defined in the standard header . As with ordinarycharacter constants, hexadecimal escapes may be used; the effect is undefinedif the specified value exceeds that representable with wchar_t .

Some of these escape sequences are new, in particular the hexadecimalcharacter representation. Extended characters are also new. The charactersets commonly used in the Americas and western Europe can be encoded to fitin the char type; the main intent in adding wchar_t was toaccommodate Asian languages.
A.2.5.3 Floating Constants
A floating constant consists of an integer part, a decimal part, a fractionpart, an e or E , an optionally signed integer exponent and anoptional type suffix, one of f , F , l , or L .The integer and fraction parts both consist of a sequence of digits. Either theinteger part, or the fraction part (not both) may be missing; either thedecimal point or the e and the exponent (not both) may be missing. Thetype is determined by the suffix; F or f makes it float , L or l makes it long double , otherwise it is double .
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «The C Programming Language, Ansi C»

Look at similar books to The C Programming Language, Ansi C. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «The C Programming Language, Ansi C»

Discussion, reviews of the book The C Programming Language, Ansi C and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.