CLA (C language) study materials
CLA (C language) study resources

CLA (C language) study plan

CLA (C language) · Give each week a clear focus.

8 weeks · About 7 hours per week

Week 1

C Essentials 1 (C101) aligned content: basics of C programming

  • Compile and run a first C program with gcc using -std=c11 -Wall -Wextra, and read every warning until the build is clean.

  • Write programs that declare and initialize int, char, float, double and _Bool variables, and print them with the correct printf conversion specifiers.

  • Trace integer division, truncation, and implicit conversions by hand, then verify each prediction by running the program.

  • Use if/else, switch, and the three loop forms to solve five small exercises such as FizzBuzz, a multiplication table, and a digit-sum loop.

Your checkpoint

A single .c file of 150-250 lines containing five small programs' worth of functions, all compiling warning-free, plus a one-page table of printf format specifiers and their matching types.

Week 2

C Essentials 1 (C101) aligned content: basics of C programming

  • Implement a number-guessing game that loops until correct, counts attempts, and validates input with scanf return values.

  • Write a program that reads a line with fgets, strips the trailing newline, and reports character counts, vowels, and reversed output.

  • Explain and demonstrate the difference between while, do-while, and for with three minimal examples you write yourself.

  • Debug three deliberately broken programs (infinite loop, off-by-one, scanf type mismatch) using gdb or printf tracing and document the root cause of each.

Your checkpoint

A working guessing game plus a debugging log listing each bug, the symptom observed, and the fix applied, at least 200 words.

Week 3

C Essentials 2 (C102) aligned content: intermediate C programming

  • Write ten of your own functions with prototypes, mixing void, value-returning, and multiple-parameter forms, and place prototypes above main.

  • Demonstrate pass-by-value versus simulated pass-by-reference using pointers, and show with a program why swapping without pointers fails.

  • Implement a recursive factorial and Fibonacci, then compare iteration versus recursion for count of calls and stack depth.

  • Use static local variables and explain their lifetime with a program that counts function calls across invocations.

Your checkpoint

A small utility library (myutils.c and myutils.h) with at least eight functions, a test main, and comments stating each function's contract.

Week 4

Functions, arrays, pointers and memory handling

  • Declare, initialize, and traverse one-dimensional and two-dimensional arrays, including computing the size with sizeof(arr)/sizeof(arr[0]).

  • Write functions that accept arrays as parameters and correctly handle the fact that array length is not passed automatically.

  • Implement linear search and binary search over an int array and verify both on sorted and unsorted input.

  • Implement bubble sort and selection sort, and print the array state after each outer pass to visualize the algorithm.

Your checkpoint

A sorting-and-searching program with four algorithms and printed pass-by-pass traces, plus a short note on when binary search is valid.

Week 5

Functions, arrays, pointers and memory handling

  • Draw memory diagrams for pointers, arrays, and pointer arithmetic, then write code that matches each diagram exactly.

  • Use pointers to pass arrays to functions and to return results through output parameters.

  • Implement string operations (strlen, strcpy, strcmp equivalents) manually with pointers and compare against the library versions.

  • Explain and demonstrate the difference between char s[] = "abc" and char *s = "abc", including what happens when you attempt to modify each.

Your checkpoint

A handwritten-then-typed pointer cheat sheet of at least 15 annotated code snippets, each with the expected output verified by running it.

Week 6

Functions, arrays, pointers and memory handling

  • Allocate, use, resize with realloc, and free dynamic arrays with malloc/calloc/free, checking every allocation for NULL.

  • Build a dynamically growing integer array with push, get, and free functions and test it with 100,000 insertions.

  • Identify and fix a double free, a use-after-free, and a memory leak in three provided-to-yourself buggy programs.

  • Run at least one program under valgrind or AddressSanitizer (-fsanitize=address) and get a clean report.

Your checkpoint

A dynamic array module that passes a sanitizer run with zero leaks and zero errors, with the sanitizer output saved as evidence.

Week 7

Structures, file I/O and preprocessor

  • Define struct types, initialize them, pass them by value and by pointer, and explain when each is preferable.

  • Use typedef, nested structs, and arrays of structs to model a small student record system with add, find, and print operations.

  • Write a program that writes struct records to a binary file with fwrite and reads them back with fread, verifying round-trip equality.

  • Handle file open failures, use feof and ferror correctly, and close every stream on all paths.

Your checkpoint

A record manager that persists at least 20 records to disk, reloads them, and prints a formatted report, with error handling for a missing file.

Week 8

Structures, file I/O and preprocessor

  • Use #define, function-like macros with parentheses, and #include guards, and show a macro pitfall such as double evaluation with ++.

  • Apply conditional compilation with #ifdef/#ifndef to build one source file in two configurations.

  • Use the predefined macros FILE and LINE inside a small debug logging macro.

  • Complete two timed mixed-domain practice sets covering all four domains and review every wrong answer.

Your checkpoint

A final mini-project (record manager split across .c/.h files with a debug-logging macro and include guards) that builds cleanly with -Wall -Wextra and passes a sanitizer run.

Milestones

Week 2: You can write, compile, and debug a 50-line program using loops, conditionals, and console input without consulting notes, and explain every compiler warning you resolved.

Week 4: You can write a function that sorts an int array in place and correctly explain why the caller sees the changes, scoring at least 80% on a self-made 20-question quiz on functions and arrays.

Week 6: Your dynamic array module runs under AddressSanitizer with zero leaks and zero errors, and you can explain in writing what malloc, realloc, and free each do to the heap.

Week 8: The final mini-project builds warning-free across multiple source files, persists and reloads data from a file, and you score at least 75% on two timed mixed-domain practice sets.