Skip to the task
Layout
Back to classic view

You are looking at lesson 1. Your place is still lesson 10, task 1: struct.

RUNTask 5 of 21 · step 3: Your first programRun p01_hello
Run p01_hello in practice/01/

File → Reload CMake Project, then pick p01_hello at the top and click ▶ (Shift+F10). You can run the same in CLion's terminal too.

Checklist

  • Every task is one commit with a clear message.

Numbered notes in the code explain the important lines.

Details & hint
$ .\build\debug\practice\01\p01_hello.exe
Hello, world!

You should see: In the Run window: Hello, world! and "Process finished with exit code 0". Exit code 0 is your return 0;.

Stuck? p01_hello is not in the list? File → Reload CMake Project again, and check that the file is called exactly CMakeLists.txt.

practice 01 main.c Code Diff +6
A · NEW FILE Create this file. Every line is new: see the green bar.
#include <stdio.h>
Note 1: Brings in stdio.h, where printf is declared.
int main(void) {
Note 2: The program starts here. Takes nothing, returns an int.
printf("Hello, world!\n");
Note 3: Prints text. \n is a new line, ; at the end.
return 0;
Note 4: 0: the program finished successfully (exit code 0).
}
opened for this task
$ .\build\debug\practice\01\p01_hello.exe
Hello, world!