Zero Knowledge C/C++ Run Code

A powerful, fast, and user-friendly VS Code extension that allows you to run C and C++ code files directly from the context menu with a single click. No complex configuration needed - just install and start coding!
✨ Features
🚀 Quick Execution
- Right-click and Run: Run C/C++ files directly from the context menu in Explorer or Editor
- Keyboard Shortcut: Press
Ctrl+Shift+B
(Cmd+Shift+B
on Mac) to instantly compile and run
- Auto-save: Automatically saves your file before compilation if there are unsaved changes
🔧 Advanced Configuration
- Multi-Compiler Support: GCC, G++, Clang, Clang++ with auto-detection
- Custom Compiler Path: Use any compiler installation
- Compiler Flags: Warnings (-Wall), Optimization levels (O1, O2, O3, Os)
- Custom Arguments: Additional compiler and runtime arguments
- Terminal Management: Per-file terminals or global terminal with cleanup options
🛠️ Developer Experience
- Cross-platform: Works on Windows, macOS, and Linux
- Syntax Checking: Real-time detection of
scanf
missing &
operator errors
- Code Snippets: Pre-built templates for C and C++ code structures
- Error Highlighting: Compiler errors and warnings in VS Code Problems panel
📱 Terminal Options
- Per-File Terminals: Dedicated terminal for each file (recommended)
- Global Terminal: Single terminal for all files
- Auto-cleanup: Close previous terminals when opening new ones
📋 Requirements
System Requirements
- VS Code: Version 1.60.0 or higher
- Compiler: GCC/G++ or Clang/Clang++ installed and available in PATH
- Platforms: Windows, macOS, Linux
Compiler Installation
Windows
# Using Chocolatey
choco install mingw
# Or download from: https://www.mingw-w64.org/
macOS
# Install Xcode Command Line Tools
xcode-select --install
# Or install Homebrew and GCC
brew install gcc
Linux (Ubuntu/Debian)
sudo apt update
sudo apt install build-essential gcc g++
Linux (Fedora/RHEL)
sudo dnf install gcc gcc-c++
# or
sudo yum install gcc gcc-c++
🚀 How to Use
- Right-click on any
.c
or .cpp
file in the Explorer or Editor
- Select "Run C/C++ Code" from the context menu
- Your code will compile and execute in a dedicated terminal
Method 2: Keyboard Shortcut
- Open a C/C++ file in the editor
- Press
Ctrl+Shift+B
(Windows/Linux) or Cmd+Shift+B
(macOS)
- Code compiles and runs instantly
Method 3: Code Snippets
Use built-in snippets for quick code structure:
- C: Type
cmain
+ Tab for main function template
- C++: Type
cppmain
+ Tab for main function template
- Additional snippets:
cfor
, cwhile
, cif
, cifelse
, cswitch
, cfunc
, cppclass
, cppvector
, etc.
⚙️ Configuration
Access settings via Ctrl+,
(File → Preferences → Settings) and search for "C/C++ Run Code":
Terminal Management
{
"run-c-code.useNewTerminalPerFile": true, // Separate terminal per file
"run-c-code.closePreviousTerminals": false // Close previous terminals
}
Compiler Configuration
{
"run-c-code.compilerType": "auto", // auto, gcc, g++, clang, clang++
"run-c-code.compilerPath": "", // Custom compiler path
"run-c-code.enableWarnings": true, // Enable -Wall warnings
"run-c-code.optimizationLevel": "none", // none, O1, O2, O3, Os
"run-c-code.additionalCompilerArgs": "", // Extra compiler flags
"run-c-code.runArgs": "" // Runtime arguments
}
Developer Features
{
"run-c-code.enableSyntaxCheck": false, // Enable scanf & checking
"run-c-code.saveFileBeforeRun": true // Auto-save before run
}
📥 Installation
From VSIX (Recommended)
- Download
zero-knowledge-c-run-code-0.1.2.vsix
- Open VS Code
- Press
Ctrl+Shift+P
(Command Palette)
- Type "Install from VSIX" and select
- Choose the downloaded
.vsix
file
From Source
git clone https://github.com/masudranaxpert/zero-knowledge-c-run-code.git
cd zero-knowledge-c-run-code
npm install
npm run package
# Install the generated .vsix file
From VS Code Marketplace
Coming soon - submit to marketplace
🐛 Troubleshooting
Compiler Not Found
Error: 'gcc' is not recognized as an internal or external command
Solution: Install GCC and ensure it's in your PATH
# Check if GCC is installed
gcc --version
# Add to PATH (Windows)
set PATH=%PATH%;"C:\MinGW\bin"
# Add to PATH (Linux/macOS)
export PATH=$PATH:/usr/local/bin
Permission Issues (Linux/macOS)
chmod +x your_program
Terminal Doesn't Open
- Check VS Code terminal settings
- Try restarting VS Code
- Verify extension is enabled
📝 Release Notes
0.1.2
- 🆕 C++ Support: Full C++ file support with
g++
- 🆕 Multi-Compiler: Support for GCC, G++, Clang, Clang++
- 🆕 Terminal Management: Per-file terminals with cleanup options
- 🆕 Code Snippets: Built-in C/C++ code templates
- 🆕 Syntax Checking: Real-time
scanf
error detection
- 🆕 Cross-platform: Improved Windows, macOS, Linux compatibility
- 🆕 Advanced Settings: Compiler flags, optimization, custom arguments
0.1.1
- 🆕 C++ Basic Support: Initial C++ file detection
- 🆕 Compiler Configuration: Basic compiler type selection
- 🆕 Terminal Options: Global vs per-file terminal modes
- 🆕 Auto-save: Save files before compilation
0.0.1
- 🚀 Initial release
- ✅ C file support with GCC
- ✅ Right-click context menu
- ✅ Keyboard shortcut (Ctrl+Shift+B)
- ✅ Terminal integration
- ✅ Auto-save feature
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with ❤️ for the C/C++ developer community
- Thanks to all contributors and testers
📞 Support & Feedback
Happy Coding with Zero Knowledge C/C++ Run Code! 🎉
