Setting Up C Programming Environment
To write C programs, you need: (1) a Text Editor to write code and (2) a Compiler to convert your code into a working program.
Option 1: Dev-C++ — Best for Windows Beginners
- Download from sourceforge.net/projects/orwelldevcpp
- Install (just click Next through the steps)
- Open Dev-C++ → File → New → Source File
- Write your code
- Press F11 to compile and run — done!
Option 2: VS Code + GCC — Professional Setup
bash
# Windows: Download MinGW from mingw-w64.org
# Add C:\Program Files\mingw64\bin to PATH
# Linux (Ubuntu/Debian)
sudo apt-get update && sudo apt-get install gcc build-essential
# macOS
brew install gcc
# Verify installation
gcc --version
# Should show: gcc (GCC) 13.x.xOption 3: Online Compiler — Zero Installation!
| Website | Best Feature | Link |
|---|---|---|
| onlinegdb.com | Built-in debugger | onlinegdb.com |
| replit.com | Save and share projects | replit.com |
| programiz.com | Beginner friendly interface | programiz.com/c-programming/online-compiler |
Compile and Run — Terminal Commands
bash
# Step 1: Write code in hello.c
# Step 2: Compile
gcc hello.c -o hello
# Step 3: Run (Linux/Mac)
./hello
# Step 3: Run (Windows)
hello.exe
# With warnings enabled (recommended)
gcc -Wall -Wextra hello.c -o hello💡 Tip: Start with an online compiler if you just want to learn! Once comfortable, set up a local IDE. Replit.com is completely free and works in any browser.