🚀 C/C++ Code Runner - The Ultimate VS Code Extension

The most comprehensive and lightning-fast C/C++ extension for Visual Studio Code. Compile, run, and format your C/C++ code with zero configuration. Perfect for beginners, competitive programming, and professional development.
🔧 About This Extension
It is an all-in-one extension for C and C++ programming in VS Code, which includes:
- Code Runner: Execute C/C++ programs instantly
- Code Formatter: Professional code formatting
- Snippets: 100+ ready-to-use code snippets
- Many more features: Everything you need for C/C++ development
⚡ Powered by Rust
This extension uses the crun
binary written in Rust for all of its core functionalities, ensuring:
- Maximum Performance: Lightning-fast compilation and execution
- Cross-Platform Reliability: Consistent behavior across all platforms
- Memory Efficiency: Optimized resource usage
- Source Code: Available at crun_rs repository
- Pre-compiled Binaries: Included for Windows, macOS, and Linux
- Standalone Usage: Download from the releases section for command-line use
🌟 Why Choose C/C++ Code Runner?
- ⚡ Lightning Fast: Compile and run C/C++ code in milliseconds with intelligent caching
- 🧠 Zero Configuration: Works out of the box with automatic compiler detection
- 🎯 One-Click Everything: Run code with F9, format with Alt+Shift+F, create files instantly
- 🔧 Smart Formatting: Automatic code formatting with industry-standard formatters
- 📝 100+ Snippets: Complete library of C/C++ code snippets for rapid development
- 🌐 Cross-Platform: Works perfectly on Windows, macOS, and Linux
- 🎮 Beginner Friendly: Perfect for learning C/C++ programming
🚀 Quick Start Guide
Step 1: Install the Extension
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "C/C++ Code Runner"
- Click Install
Step 2: Create Your First C/C++ Program
- Press
Ctrl+Shift+P
to open Command Palette
- Type "New C/C++ Source File"
- Enter your filename (e.g., "hello")
- Choose C or C++
- Start coding!
Step 3: Run Your Code
- Press
F9
to compile and run
- Press
Ctrl+F9
to force recompile and run
- See output instantly in the terminal
- Press
Alt+Shift+F
to format current file
- Code auto-formats when you save (enabled by default)
- Use Command Palette: "Format Current C/C++ File" or "Format Entire Workspace"
✨ Key Features
🎯 Instant Code Execution
- F9: Quick run with smart caching
- Ctrl+F9: Force recompile for clean builds
- Zero setup: Works immediately after installation
- Multiple output modes: Integrated terminal or dedicated output panel
- Auto-format on save: Keep your code clean automatically
- Alt+Shift+F: Format current file instantly
- Workspace formatting: Format all C/C++ files in your project
- Multiple formatter support: Works with clang-format, uncrustify, and more
🔧 Smart Compiler Detection
Automatically detects and uses the best available compiler:
For C Files:
- GCC (GNU Compiler Collection)
- Clang (LLVM C/C++ Compiler)
- Zig (Zig CC)
- Microsoft Visual C++
- Intel C Compiler
- Tiny C Compiler
- Portable C Compiler
For C++ Files:
- G++ (GNU C++ Compiler)
- Clang++ (LLVM C++ Compiler)
- Microsoft Visual C++
- Intel C++ Compiler
📝 Complete Snippet Library
C Snippets (50+):
main
→ Complete main function
printf
→ Print statement
scanf
→ Input statement
for
→ For loop structure
while
→ While loop
if
→ If statement
struct
→ Structure definition
func
→ Function template
C++ Snippets (50+):
main
→ C++ main with iostream
cout
→ Output stream
cin
→ Input stream
class
→ Class definition
vector
→ Vector container
map
→ Map container
lambda
→ Lambda function
namespace
→ Namespace declaration
🎮 Complete Usage Guide
Running Code
Action |
Keyboard Shortcut |
Description |
Quick Run |
F9 |
Compile and run with caching |
Force Recompile |
Ctrl+F9 |
Always recompile, ignore cache |
Run Menu |
Right-click → Run |
Context menu option |
Action |
Keyboard Shortcut |
Command Palette |
Format File |
Alt+Shift+F |
"Format Current C/C++ File" |
Format Workspace |
- |
"Format Entire Workspace" |
Auto Format |
On Save |
Automatic (configurable) |
Creating Files
Command Palette Method:
- Press
Ctrl+Shift+P
- Type "New C/C++ Source File"
- Enter filename
- Choose C or C++
File Explorer Method:
- Right-click in Explorer
- Select "New C/C++ Source File"
⚙️ Configuration Options
Customize the extension to your preferences:
{
"crun.runInExternalTerminal": false,
"crun.showNotifications": true,
"crun.compilerFlags": "",
"crun.formatOnSave": true,
"crun.showFormattingOutput": false
}
Settings Explained
runInExternalTerminal
: Choose between integrated terminal or output panel
showNotifications
: Enable/disable success/error notifications
compilerFlags
: Add custom compiler flags
formatOnSave
: Automatically format files when saving
showFormattingOutput
: Show output channel during formatting operations## 🎯 Perfect For
🎓 Students & Beginners
- Learn C/C++ with instant feedback
- No complex setup required
- Built-in examples and snippets
- Error messages in plain English
🏆 Competitive Programming
- Lightning-fast compilation
- Quick testing with different inputs
- Multiple compiler support
- Template snippets for contests
💼 Professional Development
- Enterprise-grade formatting
- Team collaboration features
- Consistent code style
- Workspace-wide formatting
🔬 Educators
- Easy classroom setup
- Consistent environment for all students
- Teaching-friendly interface
- Comprehensive documentation
Platform |
Status |
Compilers Supported |
Windows |
✅ Full Support |
MSVC, GCC, Clang, Zig |
macOS |
✅ Full Support |
Clang, GCC |
Linux |
✅ Full Support |
GCC, Clang, Intel, Zig |
🔥 Advanced Features
Smart Caching System
- Compile only when source changes
- Dependency tracking
- Incremental builds
- Force recompile option
Multiple Output Modes
- Integrated Terminal: See output directly in VS Code
- Output Panel: Dedicated panel for program output
- Error Highlighting: Instant error detection and highlighting
Workspace Intelligence
- Auto-detect project structure
- Multi-file project support
- Header file dependency tracking
- Workspace-wide formatting
Action |
Time |
Comparison |
First Compile |
~200ms |
5x faster than standard setup |
Cached Run |
~50ms |
10x faster subsequent runs |
Format File |
~100ms |
Instant visual feedback |
Startup Time |
~10ms |
Zero impact on VS Code startup |
🎉 What's New in v1.5.0
- Auto-format on save
- Alt+Shift+F integration
- Workspace formatting
- Multiple formatter support
- Faster compilation
- Improved caching
- Better error handling
- Optimized memory usage
🔧 Developer Experience
- Better error messages
- Improved notifications
- Enhanced documentation
- More configuration options
🤝 Contributing
We welcome contributions! Here's how you can help:
- Report Issues: Found a bug? Report it on GitHub
- Request Features: Have an idea? Let us know
- Improve Documentation: Help others learn
- Share Feedback: Tell us how we can improve
📄 License
This extension is licensed under the MIT License. See LICENSE for details.
🏆 Join Thousands of Happy Developers
"This extension made learning C++ so much easier! No more command line struggles." - Sarah K.
"Perfect for beginner in programming in c. Compile and test in seconds! no need to worry about setup and terminal commands." - Alex M.
"The formatting feature is a game-changer for our team projects." - Development Team Lead
Ready to supercharge your C/C++ development? Install now and experience the difference!
🔍 Keywords
C, C++, CPP, Compiler, Runner, Format, Formatter, Code, Programming, GCC, Clang, Visual Studio Code, Extension, Development, Fast, Quick, Easy, Beginner, Student, Competitive Programming, Professional
Made with ❤️ by Utsav Pokhrel
Follow Me
