Course Overview
C as your first language
A repair workshop needs small programs: print a pickup note, count supplies, decide which job is ready, and keep records of its tools. You'll build these programs while learning how C turns your instructions into work the computer can do.
You don't need programming experience. We'll start with what a program is, read a few lines together, and introduce the notation before asking you to use it. The examples stay small enough to trace by hand.
How to work through a lesson
A demonstration shows one idea and explains the result. Use its Run button to compare the output with the explanation. In an exercise, edit main.c in the code editor, Run your program, then Submit to check the requested result.
The demonstrations and exercises use different examples. Try to carry the idea across rather than copy the previous program unchanged. A quiz at the end of each section gives you another chance to check your understanding.
If a program won't compile, start with the first diagnostic and the line it points to. If it runs but prints the wrong result, trace the values one statement at a time. Those are different problems, and you'll practise telling them apart.
What you'll learn
- Write a first program, give values names, and print a readable result.
- Choose an action with a condition and repeat work with a loop.
- Break a program into functions. Follow a call into a function, track its parameters and local values, and see where execution resumes after
return. - Store related values in arrays and text in character arrays. Learn what an index selects and where its valid range ends.
- Use pointers to refer to existing objects. Distinguish an address from the value stored there, and check how long that object remains usable.
- Group records with structures, understand shared union storage, and use named constants, bit operations, and the preprocessor.
- Allocate storage when a program needs it, handle allocation failure, and release that storage when its work is finished.
The memory lessons use diagrams alongside code. You'll compare the lifetimes of local variables and allocated objects, see how pointer arguments let a function update its caller's data, and follow ownership through malloc and free. The diagrams are a way to reason about the program, not a promise that every compiler lays out memory identically.
Running your programs
The course editor provides the compiler and runs the supplied examples, so you don't need to install tools to begin. The exercises use fixed sample data and printed output. They don't require you to type into an interactive terminal while a program is running.
The final section explains safe output and optional local input. Keep that local workflow separate from the course editor: a program that waits for keyboard input needs an input facility that this course's Run control does not provide.
Start with What a program does. Your first exercise will produce a short workshop sign.