Back to course

Setting Up the Environment: Compiler and IDE

C Language: 0 to Hero - The Complete Beginner's Guide

Lesson 2: Setting Up the Environment

To write and run C code, you need two main tools: a text editor (or IDE) and a compiler.

The C Compiler

The compiler translates human-readable C code into machine-readable executable code. The most common compiler suite is GCC (GNU Compiler Collection).

Installation Steps (General)

  1. Linux (Debian/Ubuntu): Use sudo apt install build-essential (which includes GCC).
  2. macOS: Install Xcode Command Line Tools (xcode-select --install).
  3. Windows: Use MinGW-w64 (Minimalist GNU for Windows) or install a distribution like MSYS2, which provides GCC.

Integrated Development Environment (IDE) or Text Editor

For beginners, an IDE can simplify the compilation process, but a powerful text editor paired with a terminal is often preferred by professionals.

Tool TypeExamplesNotes
IDECode::Blocks, Visual Studio, EclipseGood for beginners, all-in-one package.
EditorVS Code, Sublime Text, VimRequires manual compilation steps, highly customizable.

Verification

After installation, open your terminal/command prompt and type:

bash gcc --version

If the installation was successful, you will see the version number of your compiler.