Don't count C out. The classic programming language remains the backbone of many modern software systems including operating systems, relational databases, libraries, embedded systems, and even the core components of other programming languages. This book teaches C23 while also building a foundation that strengthens your programming skills regardless of what language you normally program in. Starting with a tour of C, it highlights C's core concepts using example programs to give you the flavor of C. Next, it covers the entire C23 language including topics not often covered elsewhere such as undefined behavior, assertions, atomic variables, lock-free programming, debugging, advanced use of the preprocessor using _Generic, and more. Finally, it gives extended examples of how features common in modern programming languages might be implemented--including lists, maps, dynamic dispatch, and exceptions. This book includes many in-line notes containing commentary, explanations for why something is the way it is, historical context, best practices, and details often glossed over in modern languages. Additionally, it gives examples that evolve with the introduction of new language features. What You Will Learn: - Write programs in C using the new features introduced in C23. - Explore advanced or obscure parts of C not explained well elsewhere, if at all. - See how strings, lists, maps, dynamic dispatch, and exceptions might be implemented from scratch to understand what's really going on in whatever language you program in. Who This Book is for: Professional programmers, computer science instructors, students or experienced hobbyists who understand programming language concepts (variables, statements, loops, functions, arrays, classes, objects, etc.) and have basic familiarity with algorithm characterization given in "big O" notation.
不要低估 C 語言。這種經典的程式語言仍然是許多現代軟體系統的基石,包括作業系統、關聯式資料庫、函式庫、嵌入式系統,甚至是其他程式語言的核心組件。本書教授 C23,同時建立一個基礎,增強您的程式設計技能,無論您通常使用哪種語言進行編程。從 C 語言的概覽開始,強調 C 的核心概念,使用範例程式讓您體驗 C 的風味。接下來,涵蓋整個 C23 語言,包括一些在其他地方不常提及的主題,如未定義行為、斷言、原子變數、無鎖編程、除錯、使用 _Generic 的預處理器的進階用法等。最後,提供擴展範例,展示現代程式語言中常見的特性如何實現,包括列表、映射、動態調度和例外處理。
本書包含許多內嵌註解,提供評論、為何某事物如此的解釋、歷史背景、最佳實踐,以及在現代語言中常被忽略的細節。此外,還提供隨著新語言特性引入而演變的範例。
您將學到的內容:
- 使用 C23 中引入的新特性編寫 C 語言程式。
- 探索 C 語言中不常被解釋的進階或冷門部分。
- 了解字串、列表、映射、動態調度和例外處理如何從零開始實現,以理解您所編程語言中的實際運作。
本書適合對象:
專業程式設計師、計算機科學教師、學生或有經驗的愛好者,這些人理解程式語言概念(變數、語句、迴圈、函數、陣列、類別、物件等),並對以「大 O」表示法給出的演算法特徵有基本的熟悉度。
以上中文內容由 AI 翻譯