Advanced C Programming

Spring 2020 ECE 264 :: Purdue University

⚠ This is a PAST SEMESTER (Spring 2020).


Week 1: 1/13
Overview + Who Gets the Cake
Development Tools: Vim
snippets: a.c b.c
Week 2: 1/22
Number bases, how to test HW02
Test with ⓐ easy cases, ⓑ edge cases, ⓒ corner cases
notes: 20200122.pdf
Test-driven development on HW02
notes: notes.html
Week 3: 1/27
GDB, assert(…)
notes: 20200127.pdf
snippets: a.c
Code quality, memory, segments
For loops disguised as while loops
Thanks to the student who allowed us to critique their code
notes: 20200129.pdf
snippets: a.c
Strings, address syntax
&▒ ⋯ *▒ = ▒ ⋯ ▒* ▒ = ▒ ⋯ ▒[▒]
snippets: a.c b.c, c.c, d.c, e.c, f.c, g.c, h.c, i.c, j.c
Week 4: 2/3
Address syntax, address arithmetic, memory segments, GDB
notes: 20200203.pdf
HW04_bonus: TDD, due 2/5 (Wed)
HW04: Strings: mintf(…), due 2/7 (Fri)
Address syntax, relationship of '&', '*', '[▒]', types, GDB
Announcement: Know every GDB command on reference sheet for exam 1
Call by address, swap(…), memory form
⊘ “p*****r”❢❢❢
Week 5: 2/10
Build stages, preprocessor
Build stages: preprocessor, compiler, linker
#define symbols/macros, #include, #ifdef, #else, #endif
Build steps (preprocessor, compiler, linker), unit testing with miniunit, using log_▒▒▒(…) functions
Build steps (preprocessor, compiler, linker, error: “undefined reference to `▒▒▒' ⋯ error: ld returned 1”, preprocessor (#define, #include, #ifdef, #ifndef, etc.)
Week 6: 2/17
malloc(…), memory form, pass-by-addres, GDB (list, break, info breakpoints, delete, run, info locals, info frame, frame, p/▒, x/▒)
notes: 20200217.pdf
snippets: a.c b.c, c.c, d.c
Activity: GDB practice for exam 1 + test-driven development (TDD) review, example
notes: tdd gdb.pdf
snippets: gdb_exercise.c
Code coverage (line, branch, path), dynamic memory (malloc(…)), memory faults, Valgrind messages
snippets: a.c b.c, bug1.c, bug2.c, bug3.c, c.c, d.c
Week 7: 2/24
Testing HW06 with miniunit, malloc(…) pitfalls, memory faults, Valgrind, conditional jump based on uninitialized value
Collections: structures (struct), linked lists, primer for Who Gets The Cake
snippets: a.c append.c, b.c, c.c, d.c, syntax.c
Linked lists, append(…), linked lists in memory using the memory form
notes: 20200228.pdf
snippets: a.c append.c, b.c, c.c, d.c, e.c, f.c, g.c, syntax.c
Week 8: 3/2
HW07: Who Gets The Cake, due 3/5 (Thu)
Activity: append(…) function for linked lists
Week 9: 3/9
HW08: JSON 1, due 3/9 (Mon)
HW09: JSON 2, due 3/14 (Sat)
GDB x/ command, endianness, recursion
notes: 20200311.pdf
snippets: a.c isdigit.c
▶▶▶ Switch to online ◀◀◀
Note: Videos may look different depending on the day.
Week 10: 3/23
Video lecture was rolled into 3/25
HW10: Tree sort, due 3/27 (Fri)
qsort(…), function addresses
These are Boilercast videos from Spring 2019, but I have added them to this semester. If these links don't work for you, try going to Boilercast and either scrolling down or hitting Ctrl-F (or Cmd-F on Mac) to search for the topics. I am working on a new, fancier video, but it doesn't matter which one you watch. The information is the same. For the old ones, just skip the bits that we've already covered, or that don't apply to this semester.
If these links don't work for you, try going into Blackboard » Boilercast.
Week 11: 3/30
snippets: a.c b.c, c.c, d.c, f.c, g.c, h.c, i.c, j.c, k.c, l.c, m.c, m.cpp, x.c
Bytes vs. values, endianness, files
Quiz questions are for your practice, and not graded.
Week 12: 4/6
Week 13: 4/13
snippets: a.c b.c, c.c, d.c, e.f, f.c, g.c
Week 14: 4/20
Command line arguments, argv, argc, arrays of strings, error handling, goto
Images, binary files, writing/reading struct objects to/from files, Exam 3 information
Software engineering review for Exam 3, ISO C89→C99→C11→C18
Code quality, TDD, testing, typecasts
You should also watch the lecture from Mon 4/13 in its entirety, if you have not done so already.
Week 15: 4/27
Parallel programming, review of unit testing, code coverage, bugs vs. run time errors, X forwarding
HW19: Buffer overflow, due 5/2 (Sat)
EC01: BMP, due 5/2 (Sat)
Buffer overflow, stack memory, instructions, registers, assembly language
OPTIONAL: Alchemy, next steps for learning C after ECE 264

To try code snippets, right-click to copy URL. Then, in bash, type wget URL (where URL is the URL you copied from this page.) To paste in PuTTY, try Shift-Right_Mouse_Click or Shift-Insert_Key. (Do not do that in Vim.)

Assignments and deadline may be changed without notice up to 1 week before the due date.