Would you like to tell us about a lower price? If you are a seller for this product, would you like to suggest updates through seller support? Designed for professionals and advanced students, Pointers on C provides a comprehensive resource for those needing in-depth coverage of the C programming language. An extensive explanation of pointer basics and a thorough exploration of their advanced features allows programmers to incorporate the power of pointers into their C programs. Complete coverage, detailed explanations of C programming idioms, and thorough discussion of advanced topics makes Pointers on C a valuable tutorial and reference for students and professionals alike. Designed for professionals and advanced students, Pointers On C provides a comprehensive resource for those needing in-depth coverage of the C programming language.
|Published (Last):||1 September 2004|
|PDF File Size:||9.74 Mb|
|ePub File Size:||14.61 Mb|
|Price:||Free* [*Free Regsitration Required]|
Designed for professionals and advanced students, Pointers on C provides a comprehensive resource for those needing in-depth coverage of the C programming language. An extensive explanation of pointer basics and a thorough exploration of their advanced features allows programmers to incorporate the power of pointers into their C programs. Complete coverage, detailed explanations of C programming idioms, and thorough discussion of advanced topics makes Pointers on C a valuable tutorial and reference for students and professionals alike.
Why Another C Book? There are many good C books on the market; why do we need another one? In my ten years of teaching a college-level course on C programming, I have yet to find a book that covers pointers the way I would like. Many books cover pointers in a single chapter dedicated to the topic, often late in the book. It is not enough to describe the syntax of pointers and show only simple examples of their use.
I discuss pointers early and often. I describe their effective use in various contexts and show programming idioms in which they appear. I discuss related issues of program efficiency versus maintainability. Pointers are a thread that is woven throughout this book.
Why are pointers so important? My belief is that pointers are what gives C its power. Pointers allow the C programmer to implement many tasks more efficiently than is possible in other languages, and to perform some tasks, such as accessing the hardware directly, that are impossible in other languages. A thorough knowledge of pointers, then, is a prerequisite to becoming a good C programmer. However, the power of pointers comes with a price. You can cut wood faster with a chain saw than with a nail file, but the chain saw can injure you a lot more seriously, and more quickly.
Pointers are like the chain saw. Used correctly, they can simplify the implementation of an algorithm as well as make it more efficient. Used incorrectly, they can be the cause of errors that exhibit subtle and confusing symptoms and are thus extremely difficult to find. An incomplete understanding of pointers is dangerous because it invariably leads to pain rather than pleasure. This book gives you the depth of knowledge in pointers that you need to avoid the pain.
Why Learn C? Why is the C language still so popular? Historically, industry has embraced C for a number of reasons. Among these are its efficiency; good C programs can be nearly as efficient as assembly language programs, but they are considerably easier to develop.
C gives programmers more control over where data is stored and how it is initialized than many languages do. C's lack of "safety net" features also contributes to its efficiency, but increases the likelihood of errors. For example, subscripts to arrays and accesses through pointers are not checked for validity, which saves time but makes it much more important that these features be used correctly.
If the language is used with discipline, the potential problems can be avoided. The rich collection of operators provided in C give the programmer power to efficiently perform low-level computations, such as shifting and masking, without resorting to assembly language. This ability has prompted many to characterize C as being a "high-level" assembly language. However, when needed, C programs can interface easily with assembly language. These characteristics make C a good choice for implementing operating systems and software for embedded controllers.
Another reason for its popularity is its ubiquity. C compilers are widely available for a great number of machines. Who Should Use this Book? This book is not an introductory text on programming. It is intended for people who already have some programming experience and wish to learn C without being held back by discussions of why loops are important or when to use an if statement. On the other hand, I assume that the reader has no prior knowledge of C. I cover all of its many aspects.
This broad coverage makes the book useful for both students and professionals, that is, for programmers first learning C and more experienced users wishing to improve their command of the language. Organization of the Book. The book is organized as a tutorial for people with prior programming experience. It is written in the style of a mentor looking over your shoulder and giving you tips and advice.
My goal is to pass along the kind of knowledge and insight that ordinarily takes years of experience with the language to attain. This organization influences the ordering of the material—topics are generally introduced and explained completely in one place. Thus, the book is also useful as a reference. There are two notable exceptions to this organization.
The first is pointers, which are discussed in many different contexts throughout the book. The second is Chapter 1, which gives a quick introduction to the basics of the language. The introduction helps get you started writing simple programs quickly. The topics it presents are covered more thoroughly in subsequent chapters. The book is more verbose in many areas than other texts, usually to provide the depth in a topic that you would otherwise get only from experience.
In addition, I use a few examples that are not often seen in real programs. Though they may be obscure, these examples shed light on interesting aspects of the language. ANSI C. Syntax descriptions, such as the following example, and function prototypes are shown on a light gray background to help make them easy to find when you need them later.
Four typefaces are used in the syntax descriptions. Code that must be written exactly as shown such as the keyword if in this example is set in Courier. Abstract descriptions of required code such as expression above appear in Courier Italic.
Some statements also have optional parts. Code that you must write exactly as shown if you decide to use the optional part for example, the else keyword is shown in Courier Bold, and abstract descriptions of optional parts the second statement above appear in Courier Bold-Italic.
New terms are introduced with Helvetica Italic. Complete programs are numbered and displayed in the format shown in Program 0. The caption gives the title of the program. The filename in which the source code can be found appears beneath the right-hand corner—these files are available from the Addison Wesley Longman web site.
This margin symbol indicates a programming tip. Many of these tips are discussions of good programming techniques—ways to make programs easier to write and easier to read and understand later. Often a little extra effort when a program is first written can yield large time savings later when the program must be modified. Other tips will help you write code that is more compact or efficient. Other tips deal with software engineering issues. C was designed long before modern principles of software engineering evolved.
Thus, some language features and common techniques are now discouraged by these principles. The issue is often the tradeoffs between the efficiency of a certain construct and its effect on the readability and maintainability of the code. The discussions will give you the background you need to help you decide whether the gain in efficiency justifies the loss of these other qualities. Pay close attention when you see this symbol: I am pointing out one of the mistakes that beginning and sometimes experienced C programmers often make or something that does not work as you might expect it to.
The caution sign makes these hints hard to miss and easy to find later. The differences will then be important. Finally, I typeset the book myself using lwroff, a troff clone that I wrote, and I uploaded the resulting PostScript files to the publisher. Thus, the final responsibility for any errors in the book is mine. I would appreciate receiving mail about errors or other correspondence at kar cs. Chapter Questions and Programming Exercises. Each chapter ends with a selection of questions and programming exercises.
The questions range from simple syntax problems to discussions of more complex issues such as tradeoffs between efficiency and maintainability. Many of these exercises have been class tested for many years. The remaining solutions are found in the Instructor's Guide. The site includes copies of the numbered programs in the book, organized by chapter. The latest errata list is also available.
Contact your Addison Wesley Longman representative to get the Instructor's Guide, which contains the answers to the remaining questions and programming exercises. I cannot possibly list all the people who contributed to this book, yet I would like to acknowledge and thank all of them. My wife Margaret provided abundant encouragement and moral support, and she patiently put up with the disruptions to our lives that resulted from this work.
His careful critique helped me produce a clear, coherent manuscript from a binder full of lecture notes and examples. Many thanks to the students in my C Programming Seminar for their assistance in finding typos and suggesting improvements and for putting up with a textbook in draft form. You were my guinea pigs, and your reactions to what I wrote provided valuable feedback that helped me improve the text.
Jolly, Joseph F. Their suggestions and insights were a great help in refining my presentation. Deborah Lafferty, and my Production Editor, Ms.
ISBN 13: 9780673999863
Designed for professionals and advanced students, Pointers on C provides a comprehensive resource for those needing in-depth coverage of the C programming language. An extensive explanation of pointer basics and a thorough exploration of their advanced features allows programmers to incorporate the power of pointers into their C programs. Complete coverage, detailed explanations of C programming idioms, and thorough discussion of advanced topics makes Pointers on C a valuable tutorial and reference for students and professionals alike. Why Another C Book?
Pointers on C
Kenneth A. Reek , Professor of Computer Science at Rochester Institute of Technology, is an experienced C programmer who has served as a consultant for local industries. This text was born from nine years of teaching a C programming seminar. Professor Reek has taught courses at the introductory and intermediate level in operating systems, data communications, computer networks, formal languages, analysis of algorithms, and switching systems. Pointers on C. Unlike most of the literature, which focuses on the industrialized Western world, this volume devotes greater attention to the postcolonial states of Asia, Africa, and Latin America. All the authors reject the notion, proposed by its detractors and champions alike, that feminism is of middle-class origins and Western inspiration.