Modern C Up and Running: A Programmer's Guide to Finding Fluency and Bypassing the Quirks
Book information
Description
Learn how to program in modern C, from the basics through the advanced topics required for proficiency. This book is the fastest path to C fluency for anyone experienced in a general-purpose programming language. From start to finish, code examples highlight the idioms and best practices behind efficient, robust programs in a variety of areas. The book opens with a thorough coverage of syntax, built-in data types and operations, and program structure. C has quirks and presents challenges, which are covered in detail. The coverage of advanced features is what sets this book apart from others. Among the advanced topics covered are floating-point representation in the IEEE 754 standard; embedded assembly language in C code for overflow detection; regular expressions, assertions, and internationalization; WebAssembly through C; and software libraries for C and other clients. Memory efficiency and safety are the two major challenges in C programming, and you’ll explore these challenges through a series of C examples. Arrays and structures, which are the means to high-level data representation, are covered in connection with pointers, which provide efficiency. The book again uses code examples in covering networking and wire-level security; concurrency (multiprocessing and multithreading); instruction-level parallelism; and interprocess communication through shared memory and files, pipes, message queues, and signals. Many books introduce C, but few also explain how to use it properly and optimally. Essential C does just that. What You'll Learn Accelerate your path to C mastery with this book for experienced programmersRefresh your approach to program structure and data typesDive into aggregates and pointers using modern C languageRevisit storage classes and scopeDive into concurrency (multiprocessing and multithreading) and instruction-level parallelismFinish with regular expressions, assertions, signals, locales and more Who This Book Is For Professional programmers or software developers who has prior experience with C or in general wanting an accelerated learning guide to modern C programming language. Table of Contents About the Author About the Technical Reviewer Acknowledgments Preface Chapter 1: Program Structure 1.1. Overview 1.2. The Function 1.3. The Function main 1.4. C Functions and Assembly Callable Blocks 1.4.1. A Simpler Program in Assembly Code 1.5. Passing Command-Line Arguments to main 1.6. Control Structures 1.7. Normal Flow of Control in Function Calls 1.8. Functions with a Variable Number of Arguments 1.9. What’s Next? Chapter 2: Basic Data Types 2.1. Overview 2.2. Integer Types 2.2.1. A Caution on the 2’s Complement Representation 2.2.2. Integer Overflow 2.3. Floating-Point Types 2.3.1. Floating-Point Challenges 2.3.2. IEEE 754 Floating-Point Types 2.4. Arithmetic, Bitwise, and Boolean Operators 2.4.1. Arithmetic Operators 2.4.2. Boolean Operators 2.4.3. Bitwise Operators 2.5. What’s Next? Chapter 3: Aggregates and Pointers 3.1. Overview 3.2. Arrays 3.3. Arrays and Pointer Arithmetic 3.4. More on the Address and Dereference Operators 3.5. Multidimensional Arrays 3.6. Using Pointers for Return Values 3.7. The void* Data Type and NULL 3.7.1. The void* Data Type and Higher-Order Callback Functions 3.8. Structures 3.8.1. Sorting Pointers to Structures 3.8.2. Unions 3.9. String Conversions with Pointers to Pointers 3.10. Heap Storage and Pointers 3.11. The Challenge of Freeing Heap Storage 3.12. Nested Heap Storage 3.12.1. Memory Leakage and Heap Fragmentation 3.12.2. Tools to Diagnose Memory Leakage 3.13. What’s Next? Chapter 4: Storage Classes 4.1. Overview 4.2. Storage Class Basics 4.3. The auto and register Storage Classes 4.4. The static Storage Class 4.5. The extern Storage Class 4.6. The volatile Type Qualifier 4.7. What’s Next? Chapter 5: Input and Output 5.1. Overview 5.2. System-Level I/O 5.2.1. Low-Level Opening and Closing 5.3. Redirecting the Standard Input, Standard Output, and Standard Error 5.4. Nonsequential I/O 5.5. High-Level I/O 5.6. Unbuffered and Buffered I/O 5.7. Nonblocking I/O 5.7.1. A Named Pipe for Nonblocking I/O 5.8. What’s Next? Chapter 6: Networking 6.1. Overview 6.2. A Web Client 6.2.1. Utility Functions for the Web Client 6.3. An Event-Driven Web Server 6.3.1. The webserver Program 6.3.2. Utility Functions for the Web Server 6.3.3. Testing the Web Server with curl 6.4. Secure Sockets with OpenSSL 6.5. What’s Next? Chapter 7: Concurrency and Parallelism 7.1. Overview 7.2. Multiprocessing Through Process Forking 7.2.1. Safeguarding Against Zombie Processes 7.3. The exec Family of Functions 7.3.1. Process Id and Exit Status 7.4. Interprocess Communication Through Shared Memory 7.5. Interprocess Communication Through File Locking 7.6. Interprocess Communication Through Message Queues 7.7. Multithreading 7.7.1. A Thread-Based Race Condition 7.7.2. The Miser/Spendthrift Race Condition 7.8. Deadlock in Multithreading 7.9. SIMD Parallelism 7.10. What’s Next? Chapter 8: Miscellaneous Topics 8.1. Overview 8.2. Regular Expressions 8.3. Assertions 8.4. Locales and i18n 8.5. C and WebAssembly 8.5.1. A C into WebAssembly Example 8.5.2. The Emscripten Toolchain 8.5.3. WebAssembly and Code Reuse 8.6. Signals 8.7. Software Libraries 8.7.1. The Library Functions 8.7.2. Library Source Code and Header File 8.7.3. Steps for Building the Libraries 8.7.4. A Sample C Client 8.7.5. A Sample Python Client 8.8. What’s Next? Index
Similar books
Modern C Up and Running : A Programmer's Guide to Finding Fluency and Bypassing the Quirks
EPUB
Modern C Up and Running: A Programmer's Guide to Finding Fluency and Bypassing the Quirks
2022 · PDF
Java Web Services: Up and Running: A quick, practical, and thorough introduction
2009 · PDF
Java Web Services: Up and Running, 2nd Edition: A Quick, Practical, and Thorough Introduction
2013 · PDF
Java Web Services Up and Running
2013 · PDF
Java Web Services: Up and Running
2009 · PDF
Java Web Services: Up and Running
2013 · EPUB
Java Web Services: Up and Running
2013 · PDF