Lesson 1: Hello, World! — Your first C program
C is a compiled language — the code you write is translated once into machine language, and Linux and most operating systems were written in it. Every C program has a fixed structure: #include <stdio.h> brings in the output tools, int main(void) is the starting point, printf("...\n"); prints to the
Compilation is like translating a recipe you wrote in Hebrew into the only language the kitchen robot understands — you translate once, and then the robot executes at top speed without asking you again.
- printf
- A function that prints text to the screen. \n at the end of the string moves to a new line.
- main
- The function from which every C program starts running. return 0; at its end signals success.
- #include
- An instruction to the compiler to attach a header file, e.g. <stdio.h> which contains printf.
- compilation
- Translating source code into an executable in machine language, e.g. with gcc hello.c -o hello.