0%

Expert advice on C programming is hard to find. While much help is available for object-oriented programming languages, there's surprisingly little for the C language. With this hands-on guide, beginners and experienced C programmers alike will find guidance about design decisions, including how to apply them bit by bit to running code examples when building large-scale programs.

Christopher Preschern, a leading member of the design patterns community, answers questions such as how to structure C programs, cope with error handling, or design flexible interfaces. Whether you're looking for one particular pattern or an overview of design options for a specific topic, this book shows you how to implement hands-on design knowledge specifically for the C programming language.

You'll find design patterns for:

  • Error handling
  • Returning error information
  • Memory management
  • Returning data from C functions
  • Data lifetime and ownership
  • Flexible APIs
  • Flexible iterator interfaces
  • Organizing files in modular programs
  • Escaping #ifdef Hell

Table of Contents

  1. Preface
  2. I. C Patterns
  3. 1. Error Handling
  4. 2. Returning Error Information
  5. 3. Memory Management
  6. 4. Returning Data from C Functions
  7. 5. Data Lifetime and Ownership
  8. 6. Flexible APIs
  9. 7. Flexible Iterator Interfaces
  10. 8. Organizing Files in Modular Programs
  11. 9. Escaping #ifdef Hell
  12. II. Pattern Stories
  13. 10. Implementing Logging Functionality
  14. 11. Building a User Management System
  15. 12. Conclusion
  16. Index
  17. About the Author
3.147.54.6