About Online C++ Compiler
This online C++ compiler uses Clang to compile your code to WebAssembly and runs it in your browser, so your code isn't uploaded. Choose C++11, C++14, C++17, C++20 or C++23; the full standard library is there (vector, map, string, algorithm and the rest), and so is #include <bits/stdc++.h>. When the program reaches cin, type the input right in the output (recent Chrome, Edge and similar browsers), or put the sample input in the Input pane.
A project can have several .cpp and .h files compiled together. Compiler errors are marked on their lines with plain-language hints, and with run-time checks on, an array overrun, a null pointer or an integer overflow stops the program at its line. To see the values of variables, vectors and strings at every step, use the Online Debugger. C++ exceptions work too (throw, try/catch, catching by a base class, rethrowing), and one never caught is reported with its type and what().
How to use Online C++ Compiler
- 1Write code
Write C++ on the left, or pick an example.
- 2Compile and run
Press Run or Ctrl+Enter; the first time downloads the compiler.
- 3See the results
Output, compiler errors and run-time errors are on the right; click one to jump to its line.
Why use Cubfile for this
- C++11 to C++23
Compiled by Clang, with a choice of standard and optimization level.
- Contest friendly
<bits/stdc++.h> works; put the sample input in the Input pane.
- Multi-file projects
Several .cpp and .h files compile together.
- The line of a bug
Compiler errors and run-time faults such as overruns are marked on their line.
- Nothing uploaded
Compiled and run in your browser, no sign-up, no limit.