01-11-2012, 01:18 PM
Advanced C
Advanced C 1992.pdf (Size: 4.08 MB / Downloads: 32)
Introduction
C has become one of the most frequently used computer languages. The first C
language was developed by Dennis Ritchie at Bell Laboratories in 1972 and ran on a
DEC PDP-11. The ANSI standard for C, which replaced the standard written by
Kernighan and Ritchie in 1978, is only a few years old.
C’s structure is similar to PL/I (a popular language used on IBM’s mainframe
computers), FORTRAN, Pascal, and BASIC. C is a simple language. It has only a
small group of keywords and no support for I/O or advanced math. The power
of C comes from its simplicity and its use of a standard library of functions.
Who Should Read This Book?
Advanced C is for the programmer who has some experience writing applications in C
or a similar language, such as PL/I or Pascal. Regardless of whether you are an
intermediate or experienced programmer, this book is intended to improve your skills
as easily as possible.
What Is in This Book?
This book has several purposes. First, it introduces advanced parts of the C language.
It also describes changes in the ANSI standard, which is the only true definition of the
C language. In addition, the book contains much of what I have learned (often the
hard way) about C programming.
Advanced C is divided into five parts, and each part can be used by itself. Part I
gets you started and lays the groundwork for the rest of the book. In Part II, you learn
how to manage data and files when programming in C. Part III introduces integrating
C with other languages and interfacing with other environments such as database
programs. Part IV is a reference section that covers the header files, the intrinsic
functions, the preprocessor, and some performance and debugging techniques.
A Note on Practicing C
You can read, attend lectures, or discuss a subject, but as the saying goes, “practice
makes perfect.”
Do not be afraid to practice with the programs in this book. But practice does
not mean copying a program from the diskette, compiling it, and running it. Change
the example programs. Make them do things they weren’t intended to do and learn
from your mistakes. Make backups often and program away. Because C is a powerful
language and many of us are programming on PCs using DOS (which has very poor
memory protection), be careful; it is easy to trash the disk.
Good luck improving your C programming skills, have fun writing your software,
and remember Peter’s rule: Back up your disk frequently!
The C Philosophy
C probably wasn’t your first computer language. Mine was FORTRAN, and many
other people began their study of computer language with either BASIC or PASCAL.
No matter which language was your first, you probably will spend much time
programming in C from now on. This chapter covers a number of introductory topics.
A Brief History of C and the Standard
Until the past few years, no absolute standard for the C language existed. The C
Programming Language, by Kernighan and Ritchie, served as a standard, but most
compiler manufacturers added extensions and did not follow all the specifications
presented by Kernighan and Ritchie. As C became one of the most popular computer
languages for programming small computers, the need for a true standard became
apparent.