Making variables
A variable is a named box in memory that holds one value. int age = 30; makes a box called age, of type int (a whole number), and puts 30 in it. First the type, then the name, then the value.
The type decides how big the box is and what fits in it. On a typical computer an int takes 4 bytes, which is 32 bits. That holds whole numbers from about minus 2.1 billion to plus 2.1 billion.
age = age + 1; has no type in front, so it makes no new box. C++ reads the value in age, 30, adds 1, and stores 31 back in the same box. The old 30 is gone.
More types
A double holds numbers with a decimal point, like 2.5. Its box is bigger, 8 bytes, and keeps about 15 significant digits. An int cannot keep the .5: after double p = 2.5; int n = p; n holds just 2.
A char holds one character, written in single quotes: 'A'. It takes exactly 1 byte. A bool holds only true or false, the answer to a yes-or-no question. It usually takes 1 byte too.
Types also change what operators do. 7 / 2 divides two ints, so the answer is an int too: 3. The .5 is thrown away, not rounded. Write 7.0 / 2 to get 3.5, a double.
Checked by the compiler
C++ is statically typed: the compiler knows every variable's type before the program runs, and a variable keeps its type for life. While it builds the program, it checks every line against those types.
Add age = "hi"; and the compiler stops with an error. "hi" is text, and an int box holds only whole numbers. No program is built, so this mistake is caught before anything runs, and age keeps 31.
sizeof tells you how many bytes a type or variable uses. Here: int 4, double 8, char 1, bool 1. These five variables take 18 bytes. Only char is fixed at 1 everywhere; the others can differ.
What happens
;; step 1/9 · declare int age = 30; int the type: whole numbers age the name you use from now on = 30 the starting value ; every statement ends with ;
Sizes are those of today's common desktops and phones (64-bit Windows, Linux and macOS on x86-64 or ARM). The standard fixes only sizeof(char) at 1 and sets minimums: int has at least 16 bits. Check your own system with sizeof. The drawing lines the boxes up in a row. Where each variable really lives in memory is up to the compiler, which may reorder them or keep some only in CPU registers.