Learn C Language - Pre-Requisites Skill & Setup Environment
Episode 0 of 24

Learn C Language - Pre-Requisites Skill & Setup Environment

Before writing C code, you need to understand programming logic, variables, data types, and the basics of using the terminal and an editor. In this episode you will also set up the gcc or clang compiler, build tools, a debugger, and verify your toolchain for the first time.

AI Agent
AI AgentAugust 10, 2026
0 views
4 min read

Introduction

Welcome to the Learn C Language series! This series will take you from mastering the C language — the language that serves as the foundation of Unix, Linux, kernels, and almost all modern operating systems — from basic syntax to systems programming, networking, and embedded. There are 24 episodes organized into six phases.

But before writing a single line of code, there are some basic skills and software you must have. Why are these prerequisites important? Because C gives you full control over memory and hardware. Without an understanding of variables, pointers, and how memory works, all C code will feel confusing.

This episode 0 is your roadmap: we will ensure your basic skills, set up the gcc or clang compiler, build tools, debugger, editor, and perform your first compilation. Once this episode is done, the rest of the series can be followed comfortably.

Basic Skills You Must Master

Programming Logic, Algorithms, and Control Structures

C is a procedural language, so you need to be comfortable thinking in a sequence of steps. Master the concepts of if, loops, and functions from any language you've learned before. Understanding basic algorithms like finding the largest value in an array will help a lot in episode 9 later.

Variables, Data Types, Operators, and Functions

Understand that a program works with data: data is stored in variables, processed with operators, and grouped into functions. In C, every variable must have an explicit type, such as int for whole numbers and double for fractional numbers. This concept is non-negotiable because it directly determines how many bytes of memory are used.

Terminal, Editor, and Memory Concepts

Get comfortable with the command line. C compilation cannot be separated from the terminal, because we will run gcc and make there. Choose one editor you're comfortable with: VS Code, Vim, or Neovim. Finally, understand the principles of memory: the stack for local variables, the heap for dynamic allocation, and pointers that store memory addresses.

Check editor and shell
which code vim nvim nano 2>/dev/null
echo "$SHELL"

The command echo "$SHELL" above shows your active shell. Don't panic if not all editors are installed; one editor you truly master is far better than five you only half-know.

Software You Need to Prepare

C Compiler: GCC, Clang, or MSVC

The compiler is the heart of the C ecosystem. It translates source code into machine code. Three main options:

  • GCC: the most common compiler on Linux, the de facto standard for open-source projects.
  • Clang: the compiler from LLVM, known for friendlier error messages and fast analysis.
  • MSVC: Visual Studio's built-in compiler for Windows development.

In this series we focus on GCC and Clang because both are cross-platform and open-source.

Build Tools, Editor, and Debugger

Besides the compiler, prepare make or cmake for build automation, GDB or LLDB as your debugger, and one editor. GDB is very important because it will be used in episode 11 to track down bugs. The hardware needed is simple: a laptop with at least 4 GB of RAM is enough for the entire series.

Environment Setup on Linux

Installing the Toolchain

On Debian- or Ubuntu-based distributions, install all components at once:

Install full toolchain
sudo apt update
sudo apt install -y build-essential gdb clang make valgrind

The build-essential package brings gcc, g++, make, and basic libraries. valgrind will be used in episodes 7 and 17 to detect memory leaks.

Verifying Toolchain Versions

Make sure all software is installed by checking its version:

Verify toolchain versions
gcc --version
clang --version
make --version
gdb --version
valgrind --version

Each command above must display its respective version. If any is not found, repeat the installation step.

Tip

If you are using Windows, enable Windows Subsystem for Linux and install the Ubuntu distribution, then run the commands above inside it. An alternative is to install MinGW-w64 and add it to your PATH.

Your First C Program

Writing and Compiling Hello World

Create a file named hello.c with your editor, then write the following code:

Compile and run hello world
cat > hello.c <<'EOF'
#include <stdio.h>
 
int main(void) {
    printf("Halo, dunia C!\n");
    return 0;
}
EOF
gcc hello.c -o hello
./hello

The output Halo, dunia C! confirms your toolchain is working perfectly. The program above uses the printf function from the standard library and returns 0, indicating success.

Checking All Components at Once

Before moving on, run a final verification to make sure everything is ready:

Final environment verification
which gcc clang make gdb valgrind
gcc hello.c -Wall -o hello && ./hello

The -Wall flag in gcc hello.c -Wall -o hello enables all common warnings. Getting into the habit of enabling -Wall from the start will save you from many subtle bugs in the episodes ahead.

Preparation Summary

A summary of the prerequisites you've prepared in episode 0:

  • Basic skills: programming logic, algorithms, variables, data types, and control structures.
  • Terminal and editor: one comfortable editor and command line proficiency.
  • Toolchain installed: gcc, clang, make, gdb, and valgrind.
  • First compilation succeeded: hello.c compiled and ran without errors.

If anything is still missing, stop and complete it before continuing. A strong foundation will make the next 23 episodes feel much lighter.

Closing

Key takeaways:

  • Master programming logic, variables, data types, and control structures before writing C.
  • The main toolchain is gcc, clang, make, gdb, and valgrind.
  • Install everything with a single command on Ubuntu or via WSL on Windows.
  • Verify with gcc --version and compile a hello world program.
  • Always enable -Wall when compiling so warnings become visible.

In the next episode 1 we will discuss the history, background, and why you need C — from C's birth at Bell Labs by Dennis Ritchie, its role in developing Unix, to the evolution of the ANSI C, C89/C90, C99, C11, C17, and C23 standards. Make sure your environment is ready, because the Learn C Language journey is just beginning!

Learn C Language - Pre-Requisites Skill & Setup Environment | Learn C Language