C How to Program, 8/e

How to Program Series

C How to Program, 8/e introduces procedural programming in C and object-oriented and generic programming in C++. It’s appropriate for introductory- and intermediate-level C and C++ programming courses.

At the heart of the book is the Deitel signature live-code approach—we present most concepts in the context of complete working programs followed by sample executions, rather than in code snippets.

G

Source Code

h

Preface

View the Preface to learn about the book’s approach and features

h

Table of Contents

View the full Table of Contents for each chapter’s coverage.

h

Before You Begin

View the Before You Begin section for setup instructions.

Features

  • Rich coverage of fundamentals; real-world examples.
  • Integrated features of the C99 and C11 standards.
  • Secure C Programming sections.
  • Code tested on GNU gcc, Visual C++®, Xcode® LLVM.
  • Debugging with GNU gdb, Visual C++® and Xcode®.
  • Making a Difference contemporary exercises.
  • Multithreading and multi-core performance.
  • Detailed chapter summaries with page references.
  • Problem solving, data types, control statements, functions, arrays, pointers, strings, formatted I/O, structures, unions, bit manipulation, enumerations, files, data structures and preprocessor.
  • Searching and sorting with an introduction to Big O notation.
  • Treatment of object-oriented programming in C++ based on the Deitels’ C++ How to Program.

Comments from Recent Editions Reviewers

“Of any C textbook on the market, the Deitel book easily provides the clearest and most in-depth approach to standard C programming for students of all abilities. With this book, my students have a tremendous resource that will enable them to succeed not only in my classroom but in the professional workplace for years to come.
—William Smith, Tulsa Community College

“The end-of-chapter exercises are worth their weight in gold if you are learning, and especially teaching, C.
—Jim Hogg, Program Manager, C/C++ Compiler Team, Microsoft Corporation

“An excellent introductory computer science text. While C is a complex language, this book does a good job making this material accessible while providing a strong foundation for further learning.
—Robert C. Seacord, Secure Coding Manager at SEI/CERT, author of The CERT C Secure Coding Standard and technical expert for the international standardization working group for C

“The extended examples, along with the supporting text, are the best of any of the C texts I’ve seen. Running the code for the supplied examples in conjunction with reading the text provides students with a laboratory for gaining a thorough understanding of how C works.”
—Tom Rethard, University of Texas at Arlington

It would be hard for anyone not to understand pointers clearly after reading this text!
—José Antonio González Seco, Parliament of Andalusia

“A great introduction to the C programming language and software engineering. It’s fresh and up to date with modern software industry realities. Teaches pseudocode, flowcharts, algorithms and various approaches to problem solving. There are quite a few fun, involving exercises that make me want to code.
—Vytautus Leonavicius, Microsoft Corporation 

“Excellent introduction to the C language and to computer programming in general. Covers essential topics that form the foundation of any education in computer science, as well as important practices from software engineering like approaches to software design and secure programming. Additionally, each chapter offers interesting exercises, ranging from classic algorithmic challenges like the Towers of Hanoi to addressing real-world, contemporary problems. Deftly covers an impressive scope without overwhelming the student, even when covering the trickiest parts of C. C possesses a depth that can be difficult to master. By presenting key concepts in a clear and easy-to-understand manner, the book gives students the opportunity to build their knowledge from the ground up to arrive at an understanding that goes beyond merely knowing the syntax.”
—Brandon Invergo, GNU/European Bioinformatics Institute

“This book teaches a beginning programmer how to write good C programs. Covers all the topics you would expect, explained in an easy, matter-of-fact style, with lots of examples. But it also covers topics you might not expect: recursion, algorithms, Big-O notation, abstract data types, tree traversals and multithreading—in that same style that makes them simple and natural. Another excellent feature is the long list of optional coding exercises at the end of each chapter. My favorites—writing a simulator for an invented machine; then writing a compiler for a small language that targets that machine simulator.”
—Jim Hogg, Program Manager, C/C++ Compiler Team, Microsoft Corporation

“Having reviewed programming books for nearly twenty 20 years, I recognize quality right from page 1. The first sign is the use of standard terminology. And yet, C How To Program 8th Edition offers much more: it discusses C11 and C99 features, an emphasis on secure C programming including Annex K (the so-called secure standard library functions), self-testing exercises, a summary of the topics discussed in each chapter and most importantly complete code listings that have been thoroughly tested and distilled. It’s no secret that C intimidates novices. Its raw pointers, zero-based array indexes, unchecked arrays and funky strings are a fertile source of bugs and security loopholes. C How To Program addresses these issues without fear, presenting effective techniques for avoiding them. The main strength of this book is a clear, professional and reader-friendly style. Up-to-date, accurate and covers just about everything a C novice would need to know.”
—Danny Kalev, Certified System Analyst, C Expert and Former Member of the C++ Standards Committee

❝A clear introduction to computing in general and to C programming in particular; it was nice to see context and history given before diving into the language. I liked the very up-to-date examples. A great job of introducing (in Chapter 2) the core concepts behind C programming. Good use of pseudocode. A good job covering the essentials of program structure. An excellent pointers chapter; pointers are the most difficult part of learning C and the topic is presented here in a very clear and easy-to-understand way; I particularly liked the clear explanation of the different “const” combinations. I also found the function pointers section to be easy to read; finally, the sometimes pesky notation for pointers (that is, where to put the *, where to put the const, when to put parentheses) is handled neatly; nice exercises, too (particularly, the Simpletron simulator one). The Strings chapter really shines with its exercises, especially the larger-scale ones. The Formatted I/O chapter is just right—it does a fine job of explaining the detailed features of printf and scanf. Structs are explained in a very clear way—the playing card example does a very good job illustrating their use. This chapter brings back very fond memories of learning data structures in C for the first time; it does a great job of covering those lessons in a clear and interesting way; with the exercises at the end, the usefulness of these structures should become readily apparent to the student, and implementing them should be fun practice. A good job of highlighting some of the pitfalls with using macros. Great introduction to sorting—the examples do a good job illustrating sort algorithms and make it clear why some are more efficient than others. A mixed topics chapter like Other Topics is really necessary (and, I might add, very interesting to read); many of the topics in this chapter together help to indicate how the code will interact with the ‘outside world’ of the OS—redirections, errors, build systems (make), command line, etc.—which is nice.”
—Brandon Invergo, GNU/European Bioinformatics Institute

“Chapter 2, overall, is an ideal chapter to start programming with—the text is clear, the terminology is accurate but never too technical/dense, the examples are realistic (for beginners) and every detail is explained without letting the reader scratch his head looking for answers—way to go! A good introduction to pointers, const declarations and the interaction between arrays and pointers—the pointer arithmetic section is very good. Covers well the str and mem function families. Explains the essential issues of stream I/O clearly with good examples. The File Processing chapter gets the balance right between technical details and simplicity. Data Structures is unquestionably one of the best chapters in the book— I really enjoyed reading it.”
—Danny Kalev, Certified System Analyst, C Expert and Former Member of the C++ Standards Committee

“Nice example on scoping. Good clear explanation of arrays—and especially good exercises. A really good pointers chapter; the exercises are particularly good, especially the Simpletron machine simulator, reaching some fundamental and interesting computer science; makes the book much richer than simply another C textbook. String exercises are innovative and challenging. Formatted input/output examples are good—much better to illustrate what’s going on, than trying to parse the descriptions. Provides all the information required for a beginning C programmer to perform file I/O, which opens up the gateway to building realistic Apps. Good data structures chapter that guides the reader carefully thru using pointers and linked lists; the exercises are again excellent; I love the very last one on building your own compiler; by working through this example, the reader gets a good feel for the essence of how a compiler works—an exciting topic in computer science. The Other C Topics chapter contains a useful overview of advanced features. Great examples that show the evolution of each sort—it’s a good, unscary, explanation of sorting techniques. Useful overview of what features arrived with C99 and C11—multithreading is the one that will impact readers most.”
—Jim Hogg, Program Manager, C/C++ Compiler Team, Microsoft Corporation

“An excellent introduction to the C programming language, with many clear examples. Pitfalls of the language are clearly identified and concise programming methods are defined to avoid them.”
—John Benito, Blue Pilot Consulting, Inc., and Convener of ISO WG14—the working group responsible for the C Programming Language Standard

“An already excellent book now becomes superb. This new edition focuses on secure programming and provides extensive coverage of the newest C11 features, including multi-core programming. All of this, of course, while maintaining the typical characteristics of the Deitels’ How to Program series—astonishing writing quality, great selection of real-world examples and exercises, and programming tips and best practices that prepare students for industry.”
—José Antonio González Seco, Parliament of Andalusia

“A very nice selection of exercises in Chapter 3 Structured Program Development in C—good job.”
—Alan Bunning of Purdue University

“I like the structured programming summary (in Chapter 4, Program Control) with instruction on how to form structured programs by using the flow chart building blocks; I also like the range and variety of questions at the end of the chapter and the Secure C Programming section.”
—Susan Mengel, Texas Tech University

“The descriptions of function calls and the call stack will be particularly helpful to beginning programmers learning the semantics of how functions work—plenty of function exercises.”
—Michael Geiger, University of Massachusetts, Lowell

“The examples and end-of-chapter programming projects are very valuable. This is the only C book in the market that offers so many detailed C examples—I am pleased to be able to have such a resource to share with my students. Coverage of the C99 and C11 standards is especially important. For one of my classes the starting language is C and the course includes an introduction to C++—this book provides both. I feel confident that this book prepares my students for industry. Overall a great book. I always enjoy lecturing the Arrays chapter; examples are perfect for my CE, EE and CSE students—this chapter is one of the most important in my class; I find the examples to be very relatable for my students. Chapters 8 and above are used for my Data Structures class, which is taught to students majoring in Electrical Engineering and Computer Engineering; Chapter 10 plays a big role for them to understand bitwise operations—this is the only textbook that covers bitwise operations in such detail.”
—Sebnem Onsay, Special Instructor, Oakland University School of Engineering and Computer Science

“A great book for the beginning programmer. Covers material that will be useful in later programming classes and the job market.”
—Fred J. Tydeman, Tydeman Consulting, Vice-Chair of J11 (ANSI C)

“An excellent introductory C programming text. Clearly demonstrates important C programming concepts. Just the right amount of coverage of arrays. The Pointers chapter is well-written and the exercises are rigorous. Excellent discussion of string functions. Fine chapters on formatted input/output and files. I was pleased to see a hint at Big O running time in the binary search example. Good information in the preprocessor chapter.”
—Dr. John F. Doyle, Indiana U. Southeast

“I have been teaching introductory programming courses since 1975, and programming in the C language since 1986. In the beginning there were no good textbooks on C—in fact, there weren’t any! When Deitel, C How to Program, 1/e, came out, we jumped on it—it was at the time clearly the best text on C. The new edition continues a tradition—it’s by far the best student-oriented textbook on programming in the C language—the Deitels have set the standard—again! A thorough, careful treatment of not just the language, but more importantly, the ideas, concepts and techniques of programming! ‘Live code’ is also a big plus, encouraging active participation by the student. A great text!”—Richard Albright, Goldey-Beacom College

“I like the quality of the writing. The book outlines common beginner mistakes really well. Nice visualization of binary search. The card shuffling example illustrates an end-to-end solution to the problem with nice pseudocode, great coding and explanation. Card and maze exercises are very involving.”
—Vytautus Leonavicius, Microsoft Corporation

“Introduces C programming and gets you ready for the job market, with best practices and development tips. Nice multi-platform explanation [running Visual C++ on Windows, GNU C on Linux and Xcode on Mac OS X].”
—Hemanth H.M., Software Engineer at SonicWALL

“Control statements chapters are excellent; the number of exercises is amazing. Great coverage of functions. The discussions of secure C programming are valuable. The C Data Structures chapter is well written, and the examples and exercises are great; I especially like the section about building a compiler. Explanation of the sorting algorithms is excellent.”
—José Antonio González Seco, Parliament of Andalusia

“The live-code approach makes it easy to understand the basics of C programming. I highly recommend this textbook as both a teaching text and a reference.”
—Xiaolong Li, Indiana State University

“An exceptional textbook and reference for the C programmer.”
—Roy Seyfarth, University of Southern Mississippi

“An invaluable resource for beginning and seasoned programmers. The authors’ approach to explaining the concepts, techniques and practices is comprehensive, engaging and easy to understand. A must-have book.”
—Bin Wang, Department of CS and Engineering, Wright State Univ.

Pin It on Pinterest

Share This Page