Chapter Topics

Chapter Topics#

The chapters progress from program shape, output, and basic types through operators and control flow, then to arrays, functions, pointers, user-defined types, dynamic memory, and files. Each content section ends with a short exercise, and Preview, Lab, and Homework activities accompany each chapter. The table reflects the planned topics while the chapters are still in scaffold form.

Chapter

Topics

1. Introduction

Program shape and compilation; output with printf; comments and simple formatting; reading user input.

2. Variables and Types

Values, identifiers, declarations, and assignment; primitive types and literals; formatting values with printf; type sizes and conversion; constants.

3. Operators

Arithmetic expressions; assignment and update operators; comparisons and logical operators; bitwise operators.

4. Conditionals

Conditions and branch selection; multi-branch decisions; ternary expressions; switch statements.

5. Loops

Repetition and stopping conditions; while and do while loops; for loops; nested loops; controlled loop exits.

6. Arrays and Strings

Fixed arrays and indexes; traversal with loops; array size and element count; character arrays and strings.

7. Functions

Function shape and calls; parameters and return values; scope and decomposition; arrays with functions; recursion.

8. Pointers

Addresses and pointer variables; dereferencing and mutation through a pointer; pointer parameters; arrays and pointers.

9. Structs and Enums

Why related fields need a user-defined type; struct definition and field access; enum values for readable states; a short design example.

10. Dynamic Memory

Why fixed-size storage falls short; allocating and freeing a block; runtime-sized collections; resizing and cleanup; common dynamic memory mistakes.

11. Files

File motivation and paths; reading a file; writing a file; errors and cleanup.

Set up your compiler and editor with Development Environment before Chapter 1, and keep Build Reference at hand once you compile more than one file.