Skip to content

C and memory

Programs and memory in C

Lessons on this topic

Beginner · 20 minYou are hereRead

A first C program

A C program is a list of statements that run one at a time, starting in main. A compiler turns the file into a machine program before it runs.

Beginner · 25 minYou are hereRead

Variables live in memory

Every variable is a run of bytes at an address. Its type sets how many bytes it takes and how they are read.

Beginner · 25 minYou are hereRead

Functions and the call stack

Each call gets its own frame on the stack, holding copies of its arguments. The frame disappears when the function returns.

Beginner · 25 minYou are hereRead

Structs

A struct packs named fields into one block of memory, in the order written, with padding where alignment needs it. Copying a struct copies the whole block.

Related topics

Where to go next.

Phasorium

Account

Sign inWith Google, GitHub or your email

Subjects

Site

Look