The introduction toOn To Cfollows. Additionalinformation about this book, along with access to software, is availablevia http://www.ascent.com/books HowOn To CTeaches You C The purpose of this book is to help you learn the essentials ofC programming. In this section, you learn why you shouldknow C and how this book is organized. Early versions of the Unix operating system were written in a languagenamed B, which was based, in part, on a language namedBCPL. The implementers of Unix then developed another, betterlanguage, based on their experience with B. They decided to namethat new language C inasmuch as itsuperseded B.
Today, just about all computers are organized around bits, bytes, andcollections of bytes. Instruction sets vary greatly, however.Accordingly, C allows you to refer to bits, bytes, and collections ofbytes explicitly, but C does not allow you to specify computer-specificinstructions. Instead, your computer-independent, higher-level functiondescriptions are translated for you into sequences of computer-specificinstructions. Assembler languagesallow you to specify functions at the level ofcomputer-specific instructions, which operate on memory chunks of varioussizes. Thus, programs written in assembler languages are notportable. C, by contrast, allows you to specify sequences of computer-independent,conceptual instructions, which operate on memory chunks of various sizes.Thus, programs written in C are portable.
By encouraging you to think in terms of memory chunks, yet discouraging youfrom thinking in terms ofcomputer-specific instructions, C provides asensible tradeoff, enabling you to write programs that are both fast andportable. Accordingly, C is sometimes called aportable assemblerlanguage. C has became popular by virtue of attractive characteristics, such as the following: C is easy to learn. C programs are fast. C programs are concise. C compilers -- programs that translate C programs intomachine instructions -- are usually fast and concise. C compilers and C programs run on all sorts of computers,from small personal computers to huge supercomputers. Unix, a popular operating system, happens to be written in C.
There are two principal reasons to learn C: C is often the right language to use in situations requiringmaximum program speed and minimum program size. The supply of powerful off-the-shelf C software modules,both free and for sale, is huge. Also, because C is so widely used, you often hear programmers debate themerits of other languages in terms of their advantages and disadvantagesrelative to C. Four principles determined this introductory book's organization and style: The book should get you up and running in the language quickly. The book should answer your basic questions explicitly. The book should encourage you to develop a personal library of solutions to standard programming problems. The book should deepen your understanding of the art of good programming practice. To get you up and running in C quickly, the sections in this bookgenerally supply you with the most useful approach to each programmingneed, be it to display characters on your screen, to define a new function,or to read data from a file.
To answer your basic questions explicitly, this book is dividedinto parts that generally focus on one issue, which is plainlyannounced in the title of the section. Accordingly, you seetitles such as the following: How to Do Arit.