C Language
Learn C one concept at a time. Each chapter starts from the previous working program, names the new idea, produces an exact result, and states what that result still does not prove.
Your first C program: source, compiler, executable, and output
Objective Create one C source file, compile it, run the resulting executable, and verify its exact output and exit status.
Core explanation
A source file is plain text written for people and a C compiler. The compiler reads hello.c and, if the text follows C17 rules, creates an executable file named hello. Starting that executable creates a running process. The process writes one line to standard output and returns an exit status to the terminal. The program has four parts to notice now. The include line makes the declaration of puts available, main is where this small program begins, puts writes the message, and return 0 reports success. You do not need to understand headers, functions, strings, or operating-system loading yet; later chapters teach each one. For this first loop, success means only that the recorded compiler accepted this file, the executable started, the output matched, and the exit status was zero.
Name only four objects in the first loop
hello.c is a source file: editable plain text containing the program shown on the page. cc is the compiler command used by this course adapter. hello is the executable file produced after a successful compile. Starting hello creates a process, and that process produces output plus an exit status. Keep these four objects separate before learning more toolchain vocabulary.
The baseline proves a deliberately small claim. The recorded compiler accepted this one C17 source file under the shown warnings, the resulting executable started, standard output contained stage=run message=Hello, C, and the terminal observed status zero. It does not yet prove multiple-file linking, portability to another compiler, memory safety, correct behavior for other inputs, or production readiness.
Read the six source lines from the outside inward
#include <stdio.h> makes the declaration of puts available; Chapter 10 explains headers and preprocessing fully. int main(void) names where this small hosted program begins; Chapter 3 explains functions and contracts. Braces group the two statements belonging to main. A semicolon ends each statement.
puts receives the quoted message and writes it followed by a newline. Chapter 6 explains how C represents that text in memory. return 0 ends main and reports successful completion to the host environment. These forward references are intentional: the first run needs recognition, not premature mastery of every mechanism behind six lines.
Run one repeatable compile, execute, and check cycle
Work in a disposable folder containing only the saved hello.c. Run cc --version first and record the first identifying line; if the command is unavailable, stop and use the beginner setup guide instead of inventing a result. Compile with cc -std=c17 -Wall -Wextra -Wpedantic -Werror hello.c -o hello. The command states the language version, enables useful diagnostics, turns them into a failed build, names the source, and names the executable.
Only run hello after the compiler command finishes successfully. On macOS or Linux, ./hello selects the executable in the current folder. Immediately inspect the status using the terminal method from the setup guide and record exit=0. Windows learners use the documented local C17 adapter and its executable and status syntax; the evidence contract stays the same even when the command spelling differs.
Laboratory: change one thing, predict, run, and restore
First predict stage=run message=Hello, learner, then change only the words inside the quoted message. Save, compile with the identical command, run, and compare the two evidence lines. If the old message appears, do not add tools: confirm the current folder, confirm which hello.c was saved, read the compiler status, and confirm that ./hello refers to the newly built executable.
Next remove only the semicolon after puts and predict that no new executable is established by that failed command. Preserve the compiler diagnostic and nonzero status, restore the semicolon, rebuild, and recover the exact baseline. Acceptance is the original output and zero status after recovery. Multiple source files, object files, link failures, libraries, debuggers, sanitizers, Git, make, and ABI inspection remain later chapters rather than entry requirements.