C/C++ Programming Setup Guide
Welcome to your journey into C/C++ programming! This guide will help you set up everything you need to start writing, compiling, and running C/C++ programs on your computer.
Quick Start
New to programming? Follow these steps in order:
- Install a C/C++ compiler for your operating system
- Install VSCode as your code editor
- Write your first program
- Start learning C/C++ basics
Don’t worry if this seems overwhelming - we’ll guide you through each step!
What You’ll Need
Before starting, make sure you have:
- A computer running Windows 7+, macOS 10.9+, or a modern Linux distribution
- At least 2-3 GB of free disk space
- Internet connection for downloading tools
- Administrator/sudo access to install software
- About 30-60 minutes to complete the setup
Choose Your Operating System
Click on your operating system to get started:
Windows Users
-> Windows Setup Guide
- Install MinGW compiler
- Set up your development environment
- Perfect for beginners on Windows
Mac Users
-> macOS Setup Guide
- Install Xcode Command Line Tools
- Get Apple’s free C/C++ compiler
- Works on all modern Macs
Linux Users
-> Linux Setup Guide
- Install GCC compiler and build tools
- Covers Ubuntu/Debian and Fedora
- Uses your system’s package manager
Code Editor Setup
After installing your compiler, set up a great code editor:
-> VSCode Setup Guide
- Install Visual Studio Code (free)
- Add C/C++ extensions
- Learn two ways to run your programs
- Perfect for beginners and experts alike
What Each Guide Covers
Compiler Installation Guides
Each OS-specific guide includes:
VSCode Guide Features
Quick Setup Path
For experienced users who want the essentials:
- Install compiler:
- Windows: MinGW via installer
- macOS:
xcode-select --install
- Linux:
sudo apt install build-essential
(Ubuntu) or sudo dnf groupinstall "Development Tools"
(Fedora)
- Install VSCode:
- Download from code.visualstudio.com
- Install C/C++ extension by Microsoft
- Install Code Runner extension by Jun Han
- Test with Hello World:
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
Getting Help
Common Issues
Most beginners run into these problems:
- “Command not found” errors → Your compiler isn’t installed properly or not in PATH
- “Permission denied” → You need administrator/sudo access
- VSCode can’t find compiler → PATH environment variable needs to be set
- Programs won’t run → File extension might be wrong (.c vs .cpp)
Where to Find Solutions
- Check the troubleshooting section in each guide
- Verify you followed all steps in the correct order
- Restart your computer after installation (fixes many PATH issues)
- Try the alternative methods mentioned in each guide
After Setup - What’s Next?
Once you have everything installed:
- Write a few simple programs to get comfortable
- Learn the compile-and-run process until it’s automatic
- Explore VSCode features like syntax highlighting and error detection
- Try both running methods (Terminal and Code Runner) to see which you prefer
Windows Graphics Programming
Version Control with Git
- Learn Git: Essential for managing your code and collaboration. -> Git Setup Guide
Learning Path
- C Basics: Variables, data types, input/output
- Control Flow: If statements, loops, functions
- Arrays and Strings: Working with collections of data
- Pointers: Understanding memory (the tricky but powerful part!)
- Structures: Organizing related data
- File I/O: Reading and writing files
- Graphics Programming: Create visual programs with graphics.h (Windows only)
- C++ Features: Classes, objects, and more (if you want to learn C++)
Practice Resources
- Online tutorials: Many free C/C++ courses available
- Programming challenges: Sites like HackerRank, LeetCode (start with easy ones)
- Books: “C Programming: A Modern Approach” or “The C Programming Language”
- Projects: Calculator, text-based games, simple utilities
Folder Structure
Here’s how this guide is organized:
.
├── README.md ← You are here!
├── compiler/ ← Compiler setup guides
│ ├── macos.md ← macOS setup guide
│ ├── linux.md ← Linux setup guide
│ └── windows.md ← Windows setup guide
├── course/ ← Course-specific guides
│ └── graphics.md ← Graphics library setup
├── ide/ ← IDE setup instructions
│ └── vscode.md ← VSCode editor setup
├── version-control/ ← Version control setup instructions
│ └── git.md ← Git setup guide
└── resources/ ← Optional: Offline installers
├── windows/ ← Windows offline installers
├── graphics/ ← Graphics library files
└── git/ ← Git offline installers
Pro Tips for Beginners
While Learning
- Start small - Don’t try to build complex programs immediately
- Practice regularly - Even 15-30 minutes daily helps a lot
- Read error messages carefully - They usually tell you exactly what’s wrong
- Comment your code - Future you will thank present you
- Save frequently - Use Ctrl+S (or Cmd+S) often
Development Workflow
- Write code in VSCode
- Save the file with proper extension (.c or .cpp)
- Compile and run using your preferred method
- Fix any errors and repeat
- Test thoroughly with different inputs
Good Habits to Develop
- Use meaningful variable names (
studentCount
not x
)
- Keep functions small and focused on one task
- Test edge cases (what happens with zero? negative numbers?)
- Back up your code regularly
- Learn to use the debugger (gdb or VSCode’s built-in debugger)
Why This Setup?
We chose these tools because they’re:
- Free and open source - No licensing costs, ever
- Industry standard - Used by professionals worldwide
- Cross-platform - Same tools work on Windows, Mac, and Linux
- Beginner-friendly - Good error messages and documentation
- Powerful - Can handle everything from simple programs to complex projects
- Well-supported - Large community and lots of resources
Success Checklist
You’ll know your setup is complete when you can:
Ready to Start?
Choose your operating system above and begin your C/C++ programming journey!
Remember: Every expert programmer started exactly where you are now. Take it one step at a time, be patient with yourself, and don’t hesitate to revisit these guides whenever you need them.
Happy coding!
Quick Links