• Complain

Peter Prinz - C Pocket Reference

Here you can read online Peter Prinz - C Pocket Reference full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2009, publisher: OReilly Media, Inc., genre: Home and family. 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.

No cover

C Pocket Reference: summary, description and annotation

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

Peter Prinz: author's other books


Who wrote C Pocket Reference? Find out the surname, the name of the author of the book and a list of all author's works by series.

C Pocket Reference — 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 "C Pocket Reference" 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
C Pocket Reference
Peter Prinz
Ulla Prinz

Copyright 2009 O'Reilly Media, Inc.

OReilly Media Inc Chapter 1 C Pocket Reference Introduction The - photo 1

O'Reilly Media, Inc.

Chapter 1. C Pocket Reference
Introduction

The programming language C was developed in the 1970s by DennisRitchie atBell Labs (Murray Hill, New Jersey) in the process of implementingthe Unix operating system on a DEC PDP-11 computer. C has its originsin the typeless programming language BCPL (Basic Combined ProgrammingLanguage, developed by M. Richards) and in B (developed by K.Thompson). In1978, Brian Kernighan and Dennis Ritchie produced thefirst publicly available description of C, now known as the K&Rstandard.

C is a highly portable language oriented towards the architecture oftoday's computers. The actual language itself isrelatively small and contains few hardware-specific elements. Itincludes no input/output statements or memory management techniques,for example. Functions to address these tasks are available in theextensive C standard library.

C's design has significant advantages:

  • Source code is highly portable

  • Machine code is efficient

  • C compilers are available for all current systems

The first part of this pocket reference describes the C language, andthe second part is devoted to the C standard library. The descriptionof C is based on the ANSI X3.159 standard. This standard correspondsto the international standard ISO/IEC 9899, which was adopted by theInternational Organization for Standardization in 1990, then amendedin 1995 and 1999. The ISO/IEC 9899 standard can be orderedfrom the ANSI web site; seehttp://ansi.org/public/std_info.html.

The 1995 standard is supported by all common C compilers today. Thenew extensions defined in the 1999 release (called"ANSI C99" for short)are not yet implemented in many C compilers, and are thereforespecially labeled in this book. New types, functions, and macrosintroduced in ANSI C99 are indicated by an asterisk in parentheses(*).

Font Conventions

The following typographic conventions are used in this book:

Italic

Used to introduce new terms, and to indicate filenames.

Constant width

Used for C program code as well as for functions and directives.

Constant width italic

Indicates replaceable items within code syntax.

Constant width bold

Used to highlight code passages for special attention.

Fundamentals

A C program consists of individual building blocks called functions ,which can invoke one another. Each function performs a certain task.Ready-made functions are available in the standard library; otherfunctions are written by the programmer as necessary. A specialfunction name is main( ) : thisdesignates the first function invoked when a program starts. Allother functions are subroutines.

C Program Structure

illustrates the structure of a Cprogram. The program shown consists of the functionsmain() andshowPage() , and prints the beginning of a textfile to be specified on the command line when the program is started.

Figure 1-1 A C program The statements that make up the functions together - photo 2

Figure 1-1. A C program


The statements that make up the functions, together with the necessary declarationsand preprocessing directives, form the sourcecode of a C program. For small programs, the source codeis written in a single sourcefile . Larger C programs consist of severalsource files, which can be edited and compiled separately. Each suchsource file contains functions that belong to a logical unit, such asfunctions for output to a terminal, for example. Information that isneeded in several source files, such as declarations, is placed inheader files.These can then be included in each source file via the#include directive.

Source files have names ending in .c; headerfiles have names ending in .h. A source filetogether with the header files included in it is called a translation unit .

There is no prescribed order in which functions must be defined. Thefunction showPage() in could also be placed before the functionmain(). A function cannot be defined withinanother function, however.

The compiler processes each source file in sequence and decomposesits contents into tokens ,such as function names and operators. Tokens can be separated by oneor more whitespace characters, such as space, tab, or newlinecharacters. Thus only the order of tokens in the file matters. Thelayout of the source codeline breaks and indentation, forexampleis unimportant. The preprocessing directives are an exception to this rule,however. These directives are commands to be executed by thepreprocessor before the actual program is compiled, and each oneoccupies a line to itself, beginning with a hash mark (#).

Comments are any strings enclosed either between /* and*/, or between // and the endof the line. In the preliminary phases of translation, before anyobject code is generated, each comment is replaced by one space. Then the preprocessing directives areexecuted.

Character Sets

ANSI C defines two character sets. The first is the source character set , which is the set of charactersthat may be used in a source file. The second is the execution characterset , which consists of all the characters thatare interpreted during the execution of the program, such as thecharacters in a string constant.

Each of these character sets contains a basic characterset , which includes the following:

  • The 52 upper- and lower-case letters of the Latin alphabet:

    A B C D E F G H I J K L M N O P Q R S T U V W X Y Za b c d e f g h i j k l m n o p q r s t u v w x y z
  • The ten decimal digits (where the value of each character after 0 isone greater than the previous digit):

    0 1 2 3 4 5 6 7 8 9
  • The following 29 graphic characters:

    ! " # % & ' ( ) * + , - . / : ;< = > ? [ \ ] ^ _ { | } ~
  • The five whitespace characters:

    space, horizontal tab, vertical tab, newline, form feed

In addition, the basic execution character set contains the following:

  • The null character \0, which terminates acharacter string

  • The control characters represented by simple escapesequences , for controlling output devices such asterminals or printers

Table 1-1. The standard escape sequences

Escape sequence

Action ondisplay device

Escape sequence

Action ondisplay device

\a

Alert (beep)

\'

The character '

\b

Backspace

\"

The character "

\f

Form feed

\?

The character ?

\n

Newline

\\

The character \

\r

Carriage return

\o \oo \ooo(o = octal digit)

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «C Pocket Reference»

Look at similar books to C Pocket Reference. 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 «C Pocket Reference»

Discussion, reviews of the book C Pocket Reference 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.