Skip to content
C++
HomePlayground

C++ Playground

Write and run C++ instantly. Choose your compiler (GCC, Clang, MSVC), target standard (C++11–C++26), and see output or assembly in milliseconds.

1Pick a snippet or write your own code
2Click Run — compiled by GCC 14 with C++23
3Toggle assembly view, share or open in Godbolt

Full-featured playground

For multi-file projects, custom flags, and advanced sharing — use Compiler Explorer directly. Our playground uses the same API.

Open Compiler Explorer
#include <print>
#include <string_view>
#include <ranges>
#include <vector>

int main() {
    std::vector nums{1, 2, 3, 4, 5};
    auto evens = nums | std::views::filter([](int n){ return n % 2 == 0; });
    for (auto n : evens)
        std::println("Even: {}", n);
}
Open in GodboltGCC 14 · C++23