Skip to the workspace
Pebellslearn by building
Introduction to C  ›  Lesson

Where C Runs

Applications 10 minC is a compiled programming language used in systems, embedded software and libraries that need control over representation and memory. Its runtime and library requirements depend on the environment.

Set up C and run your first file

Install a compiler toolchain, then build and run a tiny program. Saving source code creates a text file; the compiler must turn it into an executable before your computer can run it.

Already set up? Continue to the lesson

New to coding? Meet the tools and find the terminal
Compiler
Checks source code and translates it into machine-code pieces.
Linker and libraries
Combine the pieces and the support needed to make an executable.
Text editor
Saves source files. The C/C++ extension in an editor does not replace a compiler.

A terminal is a window for commands. Its shell interprets those commands. PATH is the list of folders the shell searches for programs. An editor extension adds editing help; it usually does not install the language itself.

In VS Code, open your project folder, then choose View → Terminal. Type at the cursor in the Terminal panel, not in Output, the source file, or the browser address bar. Our command blocks omit prompt symbols such as $ and >; do not add them.

Official VS Code screenshot: the Terminal tab is selected below the editor, with the PowerShell shell name at the right and a command prompt at the left.
Find the Terminal tab and shell name. Open full-size screenshot (new tab).

The dropdown next to the plus button selects a shell. Choose the shell named in your operating-system instructions below. Available choices depend on what you installed.

Official VS Code screenshot: the arrow beside the terminal plus button opens a list containing PowerShell, Command Prompt, Git Bash and Ubuntu WSL.
Official documentation screenshots by Microsoft, VS Code terminal guide, CC BY 3.0 US. Unmodified; your version may look different.

Choose a system to see its installation steps. A computer is needed for these local setup instructions.

Official documentation and illustrated guides

Instructions reviewed 2026-10-27. Use the linked installer page for current versions and supported operating systems.

Continue to the lesson

c / Where C Runs

Explore each scene at your own pace.

01 · The rule

The rule

Where C Runs

C is a compiled programming language used in systems, embedded software and libraries that need control over representation and memory. Its runtime and library requirements depend on the environment.

Identify which parts of a program depend on its operating system and hardware.

The radio chip in your phone, the kernel of the server that sent you this page, and the Python interpreter many people learn first have something in common: large parts of them are written in C. A language designed in the early 1970s is still the default wherever software sits close to the machine. In this course you will grow one small program, a logger for a greenhouse sensor board, and it is exactly the kind of job C was made for.

The rule

Reach for C when every byte, cycle and wire matters.

C gives you three things that few languages give together:

  • Control of memory. You decide how big each value is and where it lives. No garbage collector moves things behind your back.
  • Predictable speed. C compiles straight to machine code. There is no interpreter or virtual machine between your program and the processor.
  • A universal interface. Almost every language can call a C function, so C is the glue between systems.

That combination explains where C shows up:

Area Examples
Operating systems The Linux kernel, large parts of Windows and macOS internals
Embedded devices Thermostats, car sensors, washing machines, our greenhouse board
Language runtimes CPython, the standard Ruby interpreter, Lua
Databases SQLite, PostgreSQL, Redis
Networking and tools The nginx web server, the curl command-line tool

Here is the first line our logger will ever have. It is tiny, and on the board it costs only a few bytes of memory:

int reading_count = 0;   /* how many temperatures we have logged */
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.