Lecture calendar

Slides 1 (Weeks 1–4) | Slides 2 (Weeks 5+)

                  LecturesReading and Materials
Week 1

Lec 1 (Jan 5): First C program, printf, variables, scanf, compilation with gcc

Lec 2 (Jan 7): Pointers (&, *), arrays, pass by pointer

Lec 3 (Jan 8): Memory model, pointer arithmetic, sizeof, exercises

Reading: King Ch. 1–2 (Introducing C, C Fundamentals); Ch. 11 (Pointers); Ch. 8 §8.1–8.2 (Arrays); Ch. 12 §12.1–12.3 (Pointers and Arrays); Ch. 9 §9.1–9.3 (Functions). Lecture notes: Hello World, Data Types, Pointers, Arrays

Learning outcomes: Run basic C programs. Begin understanding the C memory model. Use pointers and arrays.

Week 2

Lec 4 (Jan 12): const pointers, strings as char arrays, null terminator

Lec 5 (Jan 14): Pointer drills, pointers to pointers, printf format specifiers

Lec 6 (Jan 15): typedef, structs, pointers to structs (. vs ->), malloc

Reading: King Ch. 13 §13.1–13.5 (Strings); Ch. 3 (Formatted I/O); Ch. 17 §17.6 (Pointers to Pointers); Ch. 16 §16.1–16.2 (Structures); Ch. 17 §17.1 (Dynamic Storage Allocation). Lecture notes: Strings, Pointers, Structs

Learning outcomes: Develop a better understanding of the C memory model. Use strings, structs, and malloc.

Week 3

Lec 7 (Jan 19): sizeof on structs, arrays vs memory blocks, free, pointer drills

Lec 8 (Jan 21): Pointer drill practice: types, aliasing, arrays and blocks

Lec 9 (Jan 22): Struct drills: strcpy, strings in structs, arrays of structs

Reading: King Ch. 17 §17.1–17.4 (Dynamic Storage, Deallocating); Ch. 16 §16.3 (Nested Arrays and Structures); Ch. 11–12 (Pointers, Pointers and Arrays); Ch. 13 §13.5 (C String Library). Lecture notes: Structs, Pointers, Strings

Learning outcomes: Use C pointers together with structs and memory blocks, including passing to and from functions.

Week 4

Lec 10 (Jan 26): Malloc'd blocks of structs, blocks of addresses (student **), char * vs char[]

Lec 11 (Jan 28): When strcpy crashes, const char *, create_student / destroy_student

Lec 12 (Jan 29): Systematic drill: pass by value vs pointer for all three struct types

Reading: King Ch. 17 §17.1–17.4 (Dynamic Allocation, Deallocating); Ch. 17 §17.6 (Pointers to Pointers); Ch. 13 §13.2 (String Variables); Ch. 9 §9.3 (Arguments); Ch. 11 §11.4 (Pointers as Arguments). Lecture notes: Structs, Functions

Learning outcomes: Dynamically allocate structs with string fields. Understand create/destroy patterns and pass-by-value vs pass-by-pointer.

Week 5

Lec 13 (Feb 2): Valgrind, header files (.h / .c, guards), starting my_string

Lec 14 (Feb 4): Completing my_string: append, destroy, aliasing

Lec 15 (Feb 5): ++ with pointer arithmetic, ADTs vs data structures, Stack ADT (Python only)

Reading: King Ch. 15 §15.1–15.2 (Source Files, Header Files); Ch. 17 §17.2–17.4 (Dynamic Strings, Deallocating); Ch. 13 §13.5–13.6 (String Library, Idioms); Ch. 4 §4.3 (Increment/Decrement); Ch. 12 §12.1 (Pointer Arithmetic); Ch. 19 §19.1–19.4 (Modules, ADTs, Stack ADT). Lecture notes: Better Strings in C, ADTs, Stacks, Projects & GCC

Learning outcomes: Use Valgrind and header files. Implement a string ADT with dynamic memory. Understand abstract data types.

Week 6

Lec 16 (Feb 9): ArrayList ADT: append, insert, get, delete; realloc

Lec 17 (Feb 11): qsort (comparator functions, sorting structs); midterm review

Lec 18 (Feb 12): Midterm review: file parsing, two-pass reading, dot vs arrow drill

Reading: King Ch. 17 §17.3 (Dynamically Allocated Arrays); Ch. 19 §19.3–19.5 (ADTs, Design Issues); Ch. 17 §17.7 (Pointers to Functions); Ch. 26 §26.2 (<stdlib.h>, qsort); Ch. 22 §22.1–22.5 (Streams, File Operations, Line I/O). Lecture notes: ADTs

Learning outcomes: Implement a resizable array. Use qsort with custom comparators. Read and parse files in C.