Some Conventions

I l @ ve RuBoard

Some Conventions

We are almost ready to begin studying the C language itself. Here are some of the conventions we use in presenting material.

Typeface

For text representing programs and computer input and output, we use a type font that resembles what you might see on a screen or on printed output. We have already used it a few times. In case it slipped by you, the font looks like this:

 #include <stdio.h> int main(void) {     printf("Concrete contains gravel and cement.\n");     return 0; } 

Screen Output

Output from the computer is printed in the same format, with the exception that user input is shown in boldface type. For instance, here is program output from a Chapter 14, "Structures and Other Data Forms," example:

 Please enter the book title. Press [enter] at the start of a line to stop. My Life as a Budgie Now enter the author. Mack Zackles 

The lines printed in normal computer font are program output, and the boldface line is user input.

There are many ways you and a computer can communicate with each other. However, we will assume that you type in commands by using a keyboard and that you read the response on a screen.

Special Keystrokes

Usually, you send a line of instructions onward by pressing a key labeled Enter , c/r , Return , or some variation of these. We refer to this key in the text as the Enter key. When showing it as part of input in a program example, we use [enter] . The brackets mean that you press a single key rather than type the word enter .

We also refer to control characters , such as Ctrl+D. This notation means to type the D key while you are pressing the key labeled Ctrl (or perhaps Control ).

Our System

Some aspects of C, such as the amount of space used to store a number, depend on the system. When we give examples and refer to "our system," we speak of a Pentium PC running under Windows 98 and using either Microsoft Visual C++ 5.0 or Borland C/C++ 3.1 (DOS). Most of the examples have also been tested using Metrowerks CodeWarrior Pro 3 on a Macintosh G3.

We occasionally refer to running programs on a UNIX system, too. The one we use is Berkeley's BSD 4.3 version of UNIX running on a VAX 11/750 computer. Also, several programs were tested on a Pentium PC running Linux.

Note

You can find the code examples from the book by going to http://www.mcp.com/ info and typing in the ten digits of the book's ISBN (1571691618). To find out more about the Metrowerks CodeWarrior compiler, go to http://www.metrowerks.com.


I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net