Programming in C Course

Free online course · 8 lessons

Learn C from types and control flow to functions, arrays, strings, pointers, dynamic memory, structs and file I/O, and write safer C with debuggers and sanitizers. After the course you can write and debug small C programs and reason about memory.

By Studeli

Start with lesson 1

What you will learn in 8 lessons

Every lesson includes all nine study tools

  • Study Guide
  • Summary
  • Walkthroughs
  • Practice Questions
  • Flashcards
  • Explain It
  • Key Terms
  • Cheat Sheet
  • Concept Map
  1. Compile and run C programs, declare variables of the basic types and control flow with conditions and loops.

    6 learning goals
    1. 1.Build and run C programs
    2. 2.Store data in variables of the basic types
    3. 3.Display output and read input with printf and scanf
    4. 4.Compute with operators and expressions
    5. 5.Control program flow with conditions and loops
    6. 6.Recognize and prevent integer overflow
  2. Write functions with prototypes, split programs across source and header files and build them with the preprocessor and make.

    5 learning goals
    1. 1.Write, declare and call functions
    2. 2.Control where variables are visible and how long they live
    3. 3.Use the C preprocessor
    4. 4.Split a program across source and header files
    5. 5.Build multi-file programs with make
  3. Work with arrays and null-terminated strings, process command-line arguments and avoid out-of-bounds errors.

    6 learning goals
    1. 1.Store and process collections of values with arrays
    2. 2.Represent text with characters and null-terminated strings
    3. 3.Use the standard string functions
    4. 4.Organize data in multidimensional arrays
    5. 5.Process command-line arguments
    6. 6.Prevent out-of-bounds access and buffer overflows
  4. Use pointers to pass data by reference, walk arrays with pointer arithmetic and explain how variables are laid out in memory.

    5 learning goals
    1. 1.Understand memory, addresses and pointer variables
    2. 2.Use pointers to share data with functions
    3. 3.Navigate arrays with pointer arithmetic
    4. 4.Work with pointers to pointers
    5. 5.Use function pointers and callbacks
  5. Allocate and free memory on the heap, resize buffers and find leaks and invalid accesses with memory-checking tools.

    5 learning goals
    1. 1.Explain where a C program keeps its data
    2. 2.Allocate and release heap memory
    3. 3.Resize buffers with realloc
    4. 4.Recognize and prevent memory errors
    5. 5.Find memory errors with Valgrind and sanitizers
  6. Define structs and enums, and build linked lists, stacks, queues, trees and hash tables from dynamically allocated nodes.

    6 learning goals
    1. 1.Group related data with structs
    2. 2.Name choices with enums and share storage with unions
    3. 3.Build and maintain linked lists
    4. 4.Implement stacks and queues
    5. 5.Build and traverse binary trees
    6. 6.Store and look up keys with hash tables
  7. Read and write text and binary files with the standard I/O library and handle errors robustly.

    5 learning goals
    1. 1.Open files as streams and connect programs to their input and output
    2. 2.Read and write text files
    3. 3.Store and load data in binary files
    4. 4.Move to any position in a file
    5. 5.Detect, report and recover from file errors
  8. Debug C programs with a debugger and compiler warnings, recognize undefined behavior and apply practices that make C code safer.

    5 learning goals
    1. 1.Let the compiler find problems for you
    2. 2.Find and fix bugs with a debugger
    3. 3.Recognize and avoid undefined behavior
    4. 4.Catch errors at run time with assertions and sanitizers
    5. 5.Write safer C code

What to take next

More Programming courses

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started