Introduction to C & How Compilation Works
C is not just history — it still powers operating system kernels (including Linux and parts of Windows), embedded devices, microcontrollers, database engines, and performance-critical software. C gives you direct, low-level control over memory, which teaches you how computers actually work under the hood — something higher-level languages deliberately hide from you.
Unlike Python, which is interpreted line-by-line while it runs, C is a compiled language. Before your program can run, a compiler translates your entire C source code into machine code — raw instructions the CPU can execute directly. This extra compilation step is why C programs typically run much faster than interpreted ones, at the cost of needing to be recompiled every time you change the code.
Turning a .c file into a runnable program involves four distinct stages:
- Preprocessing — handles lines starting with
#, like#includeand#define, before real compilation begins - Compilation — translates your C code into assembly language
- Assembly — converts assembly into machine code, producing an object file
- Linking — combines your object file with any needed libraries into one final, executable program
Our Compiler runs all four of these steps automatically the moment you click Run.
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
#include <stdio.h> pulls in the Standard Input/Output library so you can use printf(). Every C program needs a main() function — this is where execution always begins. return 0; tells the operating system the program finished successfully.
Unlike Python, every statement in C must end with a semicolon ;. Forgetting one is the single most common beginner error, and the compiler's error message often points to the next line instead of the actual missing semicolon — so always check the line just above the reported error too.
Modify the Hello World program to print your name and a second line saying which language you're learning.
#include <stdio.h>
int main() {
printf("Hello, my name is Claude!\n");
printf("I am learning the C language.\n");
return 0;
}