Effective C (and C++)
The world runs on code written in the C programming language, yet most schools begin the curriculum with Python or Java. Effective C bridges this gap and brings C into the modern era—covering the modern C17 Standard as well as C23 features. After completing this workshop, you’ll soon be writing professional, portable, and secure C programs to power robust systems and solve real-world problems.
Book: Effective C
The world runs on code written in the C programming language, yet most schools begin the curriculum with Python or Java. Effective C bridges this gap and brings C into the modern era—covering the modern C17 Standard as well as potential C2x features. With the aid of this instant classic, you’ll soon be writing professional, portable, and secure C programs to power robust systems and solve real-world problems.
Robert C. Seacord introduces C and the C Standard Library while addressing best practices, common errors, and open debates in the C community. Developed together with other C Standards committee experts, Effective C will teach you how to debug, test, and analyze C programs. You’ll benefit from Seacord’s concise explanations of C language constructs and behaviors, and from his 40 years of coding experience.
You’ll learn:
- How to identify and handle undefined behavior in a C program
- The range and representations of integers and floating-point values
- How dynamic memory allocation works and how to use nonstandard functions
- How to use character encodings and types
- How to perform I/O with terminals and file systems using C Standard streams and POSIX file descriptors
- How to understand the C compiler’s translation phases and the role of the preprocessor
- How to test, debug, and analyze C programs
Effective C will teach you how to write professional, secure, and portable C code that will stand the test of time.
DAY ONE
GETTING STARTED WITH C
- Developing Your First C Program
- Compiling and Running Your Program
- Editors and Integrated Development Environments
- Compilers
- GNU Compiler Collection
- Clang
- Microsoft Visual Studio
- Portability
- Implementation-Defined Behavior
- Unspecified Behavior
- Undefined Behavior
- Locale-Specific Behavior and Common Extensions
OBJECTS, FUNCTIONS, AND TYPES
- Objects, Functions, Types, and Pointers
- Declaring Variables
- Swapping Values
- Scope
- Storage Duration
- Alignment
- Object Types
- Boolean Types
- Character Types
- Numerical Types
- void Types
- Function Types
- Derived Types
- Pointer Types
- Arrays
- Structures
- Unions
- Tags
- Type Qualifiers
DAY TWO
ARITHMETIC TYPES
- Integers
- Padding and Precision
- The <limits.h> Header File
- Declaring Integers
- Unsigned Integers
- Signed Integers
- Integer Constants
- Floating-Point
- Arithmetic Conversion
- Integer Conversion Rank
- Integer Promotions
- Usual Arithmetic Conversions
- Safe Conversions
EXPRESSIONS AND OPERATORS
- Simple Assignment
- Evaluations
- Function Invocation
- Increment and Decrement Operators
- Operator Precedence and Associativity
- Order of Evaluation
- Unsequenced and Indeterminately Sequenced Evaluations
- Sequence Points
- sizeof Operator
- Arithmetic Operators
- Unary + and – Operators
- Logical Negation Operator
- Multiplicative Operators
- Additive Operators
- Bitwise Operators
- Complement Operator
- Shift Operators
- Bitwise AND Operator
- Bitwise Exclusive OR Operator
- Bitwise Inclusive OR Operator
- Logical Operators
- Cast Operators
- Conditional Operator
- _Alignof Operator
- Relational Operators
- Compound Assignment Operators
- Comma Operator
- Pointer Arithmetic
Robert C. Seacord is the Standardization Lead at Woven Planet he works on the Software Craft. Robert was previously a Technical Director at NCC Group, Secure Coding Manager at Carnegie Mellon's Software Engineering Institute, and an adjunct professor in the School of Computer Science and the Information Networking Institute at Carnegie Mellon University.
He is the author of seven books, including Effective C: An Introduction to Professional C Programming (No Starch Press, 2020), The CERT C Coding Standard, Second Edition (Addison-Wesley, 2014) Secure Coding in C and C++, Second Edition (Addison-Wesley, 2013), and Java Coding Guidelines: 75 Recommendations for Reliable and Secure Programs (Addison-Wesley, 2014). He has also published more than 50 papers on software security, component-based software engineering, Web-based system design, legacy-system modernization, component repositories and search engines, and user interface design and development. Robert has been teaching secure coding in C and C++ to private industry, academia, and government since 2005. He started programming professionally for IBM in 1982, working in communications and operating system software, processor development, and software engineering and also has worked at the X Consortium, where he developed and maintained code for the Common Desktop Environment and the X Window System. Robert is on the Advisory Board for the Linux Foundation is an expert at the ISO/IEC JTC1/SC22/WG14 international standardization working group for the C programming language.