You are looking at lesson 9. Your place is still lesson 12, task 1: malloc.
No room for '\0', == instead of strcmp, = on an array, strcpy, scanf("%s") and gets, a forgotten '\n', leftovers in the input, changing a literal, strlen in bytes.
With strings most bugs are the same one: writing more than fits, or forgetting '\0'.
'\0'. char t[3] = "Ona"; compiles without any warning, but the '\0' didn't fit: printf("%s", t) prints garbage after "Ona". The array is at least the text + 1.== instead of strcmp. if (name == "Ona") compares addresses: comparison with string literal results in unspecified behavior. Write strcmp(name, "Ona") == 0.= on an array. city = "Kaunas"; gives assignment to expression with array type. Copy with snprintf.strcpy into an array that's too small. strcpy(t, "Kaunas") with char t[4] gives writing 7 bytes into a region of size 4 overflows the destination. The compiler only catches it when the text is known in advance; for typed text nothing does. Hence snprintf.scanf("%s") and gets. No size check at all. Only fgets with sizeof.'\n'. After fgets the line ends with '\n': strcmp(t, "q") will never be 0 until you cut it off.fgets. Throw it away up to '\n'.char *s = "Ona"; s[0] = 'A'; compiles, but the program crashes: literals live in read-only memory. Write const char *s and the compiler won't allow it.strlen counts bytes. strlen("ąžuolas") is 9. Count room in an array in bytes.isdigit(t[i]) without (unsigned char). The bytes of Lithuanian letters are negative in a char, and a negative value is undefined behaviour for these functions.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.