You are looking at lesson 2. Your place is still lesson 6, task 1: Arrays.
A variable, four types and their sizes, a constant, names, and why a variable always gets a starting value.
Topic 1's program always printed the same text. For a program to calculate, it needs somewhere to keep values. That is what variables are: named places in memory.
int study_year = 1;
This line declares a variable: the type int (a whole number), the name study_year and the starting value 1. From then on, the name study_year means the value kept in that place.
Assignment stores a new value, and the old one is gone:
study_year = 2;
In C, = means "store", not "equals". Whether two values are equal is tested with == (topic 3).
The type says what kind of value a variable holds and how much room it takes. Four are enough for this course:
| Type | What | Size | Values | printf |
|---|---|---|---|---|
int |
a whole number | 4 B | from −2,147,483,648 to 2,147,483,647 | %d |
long long |
a big whole number | 8 B | up to ±9.2 · 10¹⁸ | %lld |
double |
a real number | 8 B | about 15–16 exact digits | %f |
char |
one character | 1 B | 'A', '7', '\n' |
%c |
These are the sizes with our compilers: MinGW in CLion and GCC on GitHub. The C standard does not fix them exactly, so you find the real size with sizeof (step 3).
8.75, not 8,75.char holds a character in single quotes: 'A'. Double quotes "A" make a string (topic 9).char is really a small number: 'A' is 65 in memory. Lithuanian letters like ą and ž don't fit in one char: in UTF-8 they take 2 bytes each.If a value must not change in the program, add const:
const int current_year = 2026;
Trying to change it is a compile error:
main.c:5:18: error: assignment of read-only variable 'current_year'
5 | current_year = 2027;
| ^
a–z, A–Z, digits and _ are allowed. A name cannot start with a digit.average and Average are two different names.amžius too, but not every tool does. The course code uses English names: age, average.average, not a. More in topic 4.A variable without a starting value (int sum;) holds whatever was in memory at that moment: a random number. The course flags often catch it:
main.c:5:9: error: 'sum' is used uninitialized [-Werror=uninitialized]
5 | sum = sum + 5;
| ~~~~^~~~~~~~~
But not always, so the habit is simple: declare a variable and give it a value right away.
Each one ticks itself when you do it.
All six done. You know your way around.
It is laid out like CLion: the same panels in the same places. This tour shows each one, and you can reopen it any time with Tour.
Switches the left panel: Lesson plan, Project files, Changes. Click the active icon again to hide the panel.
In CLion: the tool window bar runs down the left edge, too.
This part is not on this task: it appears when a task needs it.
Every task in this lesson. Now marks your place. Clicking a task only lets you look; it never moves your place. Project files and Changes open here too.
In CLion: this spot holds the Project view (the file tree).
This part is not on this task: it appears when a task needs it.
Opens the file for your task by itself. A tab appears for each file the step opens. The breadcrumbs above the code show the folder.
In CLion: the same editor tabs and breadcrumbs.
This part is not on this task: it appears when a task needs it.
Diff shows what changed, like git diff: red is the old code, green the new.
In CLion: the diff view in the Commit window looks the same.
This part is not on this task: it appears when a task needs it.
Terminal for build commands, Database to see your tables. They open by themselves when a task needs them. Drag the top edge to resize.
In CLion: Terminal, and the Database tool window.
This part is not on this task: it appears when a task needs it.
What to do now, right above the code, so you never miss it. Numbered notes in the code explain the important lines. Details shows what you should see and a hint.
In CLion: no equivalent: this is your lecturer's guide.
This part is not on this task: it appears when a task needs it.
Done is the only button that moves you forward. Look back lets you review without losing your place.
This part is not on this task: it appears when a task needs it.
Guided, Focus code or Floating. You can drag the panel edges too. Your layout is remembered for next time.
In CLion: you can also rearrange and hide tool windows.
This part is not on this task: it appears when a task needs it.
Six small missions. Each one ticks itself when you do it, so you know you have found everything.