C++ Compiler
Create, run, debug, save and share C++ code



































C++ Compiler Features
💻 Professional Code Editor
Write and edit C++ code directly in your browser with Monaco editor - the same engine that powers VS Code.
- Syntax highlighting and IntelliSense for C++17
- Dark theme with line numbers and code folding
- Auto-completion and multi-cursor editing
- Professional IDE layout with multiple panels
▶️ Compile & Run
Compile and execute C++ code instantly with GCC compiler and real-time output.
- C++17 standard with GCC compiler
- 10-second execution timeout for safety
- Input/Output panels for stdin/stdout
- Clear error messages and compilation feedback
🐞 GDB Debugger
Debug your C++ programs with integrated GDB support and detailed stack traces.
- Compile with debug symbols (-g flag)
- Automatic stack trace and backtrace analysis
- Variable inspection and crash analysis
- Dedicated Debug panel for output
🖥️ Integrated Terminal
Execute shell commands directly in the IDE for advanced workflows.
- Run compiler commands manually (g++, gcc)
- File operations (ls, pwd, cat, mkdir)
- Check versions and system information
- 10-second timeout per command
📦 Package Manager
Install popular C++ libraries with one click - no manual setup required.
- Boost, libcurl, jsoncpp, SQLite3, OpenSSL
- Graphics libraries: SFML, SDL2, OpenGL
- GUI frameworks: Qt5, GTK+
- Image processing: libpng, libjpeg, OpenCV
💾 Save & Share
Persist your code and share with others via permanent URLs.
- Save code to database with unique share IDs
- Share permanent URLs with view tracking
- Fork shared code to create your own copy
- No account required - link-based access
C++ Compiler Keyboard Shortcuts
Keyboard Shortcut | Command | Description |
---|---|---|
Ctrl+S / Cmd+S | Save code | Saves your current code to the database with a unique ID. |
Ctrl+Enter / Cmd+Enter | Run code | Compiles and executes your C++ program with live output. |
Ctrl+Shift+D | Debug code | Compiles with debug symbols and runs GDB debugger. |
Ctrl+/ / Cmd+/ | Toggle line comment | Adds or removes comment markers (//) from selected line(s). |
Ctrl+F / Cmd+F | Find in code | Opens the search box to find text within the code editor. |
Ctrl+H / Cmd+H | Find and replace | Opens the replace dialog to search and replace text. |
Alt+Up / Alt+Down | Move line up/down | Moves the current line (or selection) up or down in the editor. |
Ctrl+D / Cmd+D | Duplicate line | Duplicates the current line or selected code block. |
Alt+Click | Add cursor | Adds another cursor for multi-line or multi-location editing. |
Ctrl+Shift+L | Select all occurrences | Selects all instances of the current word for multi-editing. |
Shift+Alt+F | Format code | Auto-formats your C++ code with proper indentation. |
Ctrl+Space | Trigger IntelliSense | Opens auto-completion suggestions for C++ keywords and functions. |
Ctrl+1 / Ctrl+2 / Ctrl+3 | Focus panel | Jumps to Editor / Output / Terminal panels respectively. |
Ctrl+B | Toggle sidebar | Shows or hides the left sidebar (Files/Packages tabs). |
Tab / Shift+Tab | Indent / Unindent | Indents or unindents selected code blocks. |
Experience the power of Replit AI

This entire C++ compiler app was built in 14 minutes by Replit Agent 3. Replit's environment facilitates rapid development, iteration and testing code for users of any technical ability. Develop software faster and better with Replit’s autonomous AI.
Get started freeFrequently Asked Questions
⏱️ Why did my code stop running after 10 seconds?
All code executions have a 10-second timeout to prevent infinite loops and resource abuse. If you need longer execution, optimize your algorithm or break your task into smaller parts. This applies to compilation, execution, and terminal commands.
📦 How do I install external C++ libraries?
Click the Packages button to browse and install popular C++ libraries with one click. Available libraries include Boost, libcurl, jsoncpp, SQLite3, OpenSSL, SFML, SDL2, Qt5, and more. After installation, include headers in your code like #include <boost/algorithm/string.hpp>
. Some libraries may require linking flags when compiling manually in the terminal.
💾 How does code saving and sharing work?
The IDE does NOT auto-save - you must click the Save button (Ctrl+S) to store your code in the database. After saving, click Share to get a permanent URL. Anyone with the link can view your code and click Fork to create their own editable copy. Each shared code tracks view counts and fork counts automatically.
🤝 Can I collaborate with others in real-time?
Real-time collaboration is not currently supported. However, you can share your code URL with others to view, and they can fork it to create their own copy. Work asynchronously by sharing updated links. Future updates may include live collaboration features.
🛠️ What C++ version and compiler are used?
The IDE uses GCC (GNU Compiler Collection) with C++17 standard by default. You can check the version by running g++ --version
in the terminal. The platform is Linux x86_64 architecture. You can customize compilation flags in the terminal for different standards like C++20 using g++ -std=c++20 main.cpp -o program
.
🐞 How does the GDB debugger work?
Click the Debug button to compile your code with the -g
flag (debug symbols) and automatically run GDB. The debugger shows stack traces, backtraces, and variable values in the dedicated Debug tab. This is best for crash analysis and basic debugging. For advanced interactive debugging, use the terminal: gdb ./program
.
⌨️ How do I provide input (stdin) to my program?
Use the Input tab in the right panel to type your program's stdin input, then click Run. Alternatively, in the terminal, save input to a file and use redirection: echo "test input" > input.txt
then ./program < input.txt
. The Input panel is the simplest method for interactive programs.
💻 What can I do in the integrated terminal?
The terminal supports file commands (ls, pwd, cat, mkdir
), system info (uname, whoami
), compiler tools (g++ --version, make --version
), and manual compilation (g++ -O2 main.cpp -o program
). Limitations: no interactive programs like vim/nano, and 10-second timeout per command. Perfect for custom build workflows and testing.
🗂️ Can I save multiple files or create projects?
Currently, the IDE supports single-file compilation only (main.cpp). Each save creates a new unique share ID. To create different versions, fork your own code or use different browser tabs with different share URLs. Multi-file project support with header files and separate compilation units is planned for future updates.
🚪 What happens to my code when I close the browser?
If you clicked Save, your code is permanently stored in the database and accessible via the share URL indefinitely. If you did NOT save, your code is lost when you close or refresh the page. Always click Save before closing to preserve your work. Share URLs are permanent and never expire.
🔒 Is my code private or public?
Unsaved code is only visible to you in your current session. Saved code is stored in the database but not publicly listed. Anyone with your share URL can view your code - treat share links as private and only share with intended recipients. Currently there is no authentication system, so links are the only access control.
⚠️ What if the IDE isn't working or I get errors?
For compilation errors, check the error messages in the Output tab and verify C++ syntax. For runtime crashes, use the Debug button to see stack traces. For timeout errors, optimize your code to run under 10 seconds. For package issues, verify installation via terminal: dpkg -l | grep <package>
. If the IDE freezes, refresh your browser and avoid infinite loops in code.
Build and ship, all in the editor
Code and collaborate in the browser with Replit’s AI-powered cloud development environment.