Right-click and save the links.

Safari users: stop using Safari. No but really, it will change the extension of the files when you save them, for some reason.

Intro and C Basics
1_hello_world.c Welcome to C!
1_cant_add_strings.c You're not in Java-land anymore.
1_variable_weirdness.c "Fun" things can happen when you don't initialize variables.
1_printf.c Printing things out with C's version of System.out.println.
1_fgets.c Getting input with fgets... kinda.
2_get_line_fail.c Coming up with the signature for a function that takes an array parameter.
2_get_line_success.c The proper way to write the get_line function.
2_get_line_prototype.c Using a function prototype to access a function before it's defined.
2_return_array_fail.c Returning local arrays is a bad idea.
3_strings_are_bad.c Strings in C are bad, okay?
3_cant_modify_literals.c String literals are different beasts.
3_str_size_length.c strlen() and sizeof() are very different things.
3_read_write_text_file.c Reading/writing text files is pretty straightforward.
4_food_file.c Reading/writing binary files is also pretty straightforward.
Structs, Enums, Typedefs
4_food_struct.c How to define and use a simple struct.
4_linked_list.c Making self-referential struct pointers.
4_enum_color.c Common patterns for using enums.
5_arrays_are_pointers.c Yep. Shows array address calculation.
5_2d_arrays.c There are two completely incompatible kinds of 2D arrays in C. Great.
6_const_ptrs.c The const keyword is a neat addition to pointers.
6_ptr_casts.c Pointer casting lets you "reinterpret" the meaning of bit patterns.
Linked list (Click "Visualize Execution") Very basic linked list on the heap.
Use-after-free (Click "Visualize Execution") after freeing heap memory, it's invalid.
14_qsort.c Using qsort.
14_qsort_structs.c Another qsort example, but sorting structs this time.
ArraySorting.java That same example, done with equivalent Java features.
4_cmd_args.c Command-line arguments, like you'll need for proj1!
4_sizeof.c sizeof() might not work how you expect.
11_a_terrible_function.java Here's exactly how NOT to write a function. Thanks, MARS.
11_a_better_function.java Pseudocode improvement of the previous function.
12_asm_test.c Stuff to look at in gdb.
Multi-file compilation and make
build.sh A very simple build script. You'll have to chmod +x it to use it.
Makefile The makefile for the following example.
10_main.c The main file.
10_user.c The second file.
10_user.h The header file for 10_user.c.
Linking and Loading
13_main_island.c Goes with the next file.
13_sub_island.c Goes with the previous file.
14_innocent.c Goes with the next file.
14_bad.c Goes with the previous file.
17_fork.c Demonstrates the fork() POSIX API function.
17_exec.c Demonstrates the execvp() POSIX API function.
17_waitpid.c Seeing how a child process terminated.
17_signal.c Setting up a signal handler for... nefarious purposes...
Kernel Modules and Drivers
19_hellomod.tar A very simple "hello world" module.
19_hello_dev.tar A simple device driver.
21_thread_test.c Makes 5 threads. But without joining, they do weird stuff...
21_thread_quantum.c Shows how 2 threads alternate in time, but in an arbitrary way.
22_strtok.c Multiple threads + one global variable = sadness.
22_strtok_r.c Multiple threads + reentrant strtok = happiness.
22_thread_racing.c A classic race condition where 2 threads try to change 1 variable.
22_thread_cooperating.c The fixed version of the previous example.
22_bad_critsec.c Another version of the previous, but with a worse design.
23_spinwait.c If one thread has to wait for another, "spin-waiting" is not the best way.
23_condvar.c Condition variables are a better way for threads to say "hey, wake up!"
23_prodcons.c A producer-consumer example using condition variables.
24_deadlock.c A very simple kind of deadlock.