Millions of students and professionals worldwide have learned programming with Deitel® books, videos, e-books, online articles, instructor-led training and resource centers. 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. Features include:
- 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.
- New treatment of object-oriented programming in C++ based on the Deitels’ C++ How to Program, 9/e.
- See the Preface for more.
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.
C++ Testimonials (Content Selected from the Deitels’ C++ How to Program, 9/e Textbook)
"Gets you into C++ programming quickly with relevant and important tips, excellent exercises, gradual progression towards advanced concepts and comprehensive coverage of C++11 features."—Dean Michael Berris, Google, Member ISO C++ Committee
"The examples are accessible to CS, IT, software engineering and business students."—Thomas J. Borrelli, Rochester Institute of Tech.
"An excellent ‘objects first’ coverage of C++ accessible to beginners."—Gavin Osborne, Saskatchewan Inst. of App. Sci. and Tech.
"As an instructor, I appreciate the thorough discussion of the C++ language, especially the use of code examples and demonstration of best coding practices. For my consulting work I use the Deitel books as my primary reference."—Dean Mathias, Utah State University
"Extensive coverage of the new C++11 features: list-initialization of scalar types and containers, nullptr, range for-loops, scoped enumerated types, inheritance control keywords (override and final), auto declarations and more. Code tested meticulously with three leading, industrial-strength compilers."—Danny Kalev, C++ expert, Certified System Analyst and former member of C++ Standards Committee
"Just when you think you are focused on learning one topic, suddenly you discover you’ve learned more than you expected."—Chad Willwerth, U. Washington, Tacoma
"The virtual function figure and corresponding explanation in the Polymorphism chapter is thorough and truly commendable."—Gregory Dai, eBay
"The Object-Oriented Programming: Inheritance chapter is well done. Excellent introduction to polymorphism."—David Topham, Ohlone College
"Thorough and detailed coverage of exceptions from an object-oriented point of view."—Dean Mathias, Utah State University
"Good use of diagrams, especially of the activation call stack."—Amar Raheja, California State Polytechnic University, Pomona
"Terrific discussion of pointers—the best I have seen."—Anne B. Horton, Lockheed Martin
"I especially value the code examples and diagrams. Great coverage of OOP. Nice detail in Intro to Classes—students can learn so much from it; I love that every line of code is explained and that UML class diagrams are given. Good visuals provided for what’s going on in memory [for pass-by-value and pass-by-reference]. The Inheritance examples nicely reinforce the concepts. I love the description of [a possible] polymorphic video game."—Linda M. Krause, Elmhurst College
"The Introduction to Classes, Objects and Strings examples are solid."—Dean Michael Berris, Google, Member ISO C++ Committee
"The pointers chapter manages to explain something that’s quite difficult to teach: the elusive nature of pointers. The Operator Overloading chapter explains the topic clearly and builds a convincing, realistic Array class that demonstrates the capabilities of OOD and C++."—Danny Kalev, C++ expert, Certified System Analyst and former member of C++ Standards Committee
"I like the idea of std::array [not built-in arrays] by default. Exception Handling is accurate and to the point."—James McNellis, Microsoft Corporation
"Novices and advanced programmers will find this book an excellent tool for learning C++. Really fun and interesting exercises."—José Antonio González Seco, Parliament of Andalusia
"I really like the Making a Difference exercises. The dice and card games get students excited."—Virginia Bailey, Jackson State University
"Provides a complete basis of fundamental instruction in all core aspects of C++."—Peter DePasquale, The College of New Jersey
"Great coverage of polymorphism and how the compiler implements polymorphism ‘under the hood.’"—Ed James-Beckham, Borland
"Will get you up and running quickly with the smart pointers library.~—Ed Brey, Kohler Co.
"Replete with real-world case studies. Code examples are extraordinary!"—Terrell Hull, Logicalis Integration Solutions