Series 4: Advanced C
With pointers and memory under your belt, you're ready for C's advanced features: structs, file I/O, function pointers, void pointers, and linked lists. This is where C starts to feel like a real systems language — you'll build generic data structures from scratch.
Lessons
Week 8: Structs & File I/O
Structs & typedef
struct, typedef, unions. C’s version of Java classes – data without methods.
Struct Pointers & Arrow Operator
The -> operator, passing structs by pointer, arrays of structs on the heap.
File I/O in C
fopen, fclose, fprintf, fscanf, fgets. Error checking and comparison to Java’s Scanner and PrintWriter.
Week 9: Function Pointers & Generics
Function Pointers
Storing and calling functions by pointer. C’s version of Java interfaces and callbacks.
Void Pointers & Generics
void * as the universal pointer. Type erasure, casting, and why qsort works on any type.
Generic Data Structures
Linked lists with void pointers and function pointers. Building Java-like generics by hand in C.
Related resources:
- C vs Java Cheat Sheet — structs vs classes, file I/O, and error handling sections
- CTF Challenges — struct, file I/O, and function pointer challenges for Weeks 8–9
Previous series: ← Series 3: Pointers & Memory
Next series: Series 5: Systems Programming →