1. Meet C and the compiler
BeginnerUnderstand the edit-compile-run cycle and write small programs with clear input and output.
Source code and main
A C compiler translates source code into a program the computer can run.
Types and variables
A declaration gives a name storage with a particular type.
Input and output
Use standard I/O functions with attention to their return values.
Module checkpoint: Try it: sketch a C program that reads one whole number, checks that input succeeded, and prints a derived value.
2. Make decisions and repeat
BeginnerUse conditions and loops to express rules and repeat work deliberately.
Conditions and branches
if and else choose which statement block runs.
Count with for
A for loop groups initialization, condition, and update.
Repeat with while
while repeats as long as its condition remains true.
Module checkpoint: Try it: trace a loop in a table with columns for the counter, condition, and output before you compile it.
3. Functions, arrays, and strings
BeginnerSplit work into functions and understand how arrays and C strings are represented.
Function declarations and calls
Functions name reusable operations and define their inputs and result.
Arrays and bounds
An array stores a fixed number of same-typed elements in sequence.
Characters and C strings
A C string is a character array ending with a null terminator.
Module checkpoint: Try it: pass an array and its length to a function, then test the first, last, and one-element cases.
4. Understand pointers and memory
IntermediateFollow addresses, use pointers safely, and manage dynamically allocated storage.
Addresses and pointers
A pointer stores the address of an object.
Pointers as output parameters
A function can modify a caller's object through a pointer.
Dynamic memory and ownership
Heap allocations need an explicit lifetime and a matching free.
Module checkpoint: Try it: identify who owns each allocated block in a small program and when that owner releases it.
5. Model data and split programs
IntermediateCreate structs for related data and separate interfaces from implementations.
Structs and records
A struct combines related fields into one application-defined type.
Headers and source files
Headers declare interfaces; source files provide implementations.
Scope, const, and interfaces
Clear scope and const-qualified inputs communicate intent.
Module checkpoint: Try it: define a small record type and list which functions should create, validate, print, and update it.
6. Files, algorithms, and safe boundaries
AdvancedCheck file operations, reason about algorithm growth, and assemble a complete C project.
Files and error paths
File operations can fail and should be checked.
Search and algorithm growth
A clear baseline helps compare better algorithms.
Build a dependable C project
Compilation, warnings, tests, and clear ownership support reliable code.
Module checkpoint: Review your capstone for input validation, clear error paths, array bounds, and a single owner for each allocation.