Zest.

C++: Hello world

A short, tested C++ example for hello world. Copy it and adjust the names and paths for your project.

C++
#include <iostream>

int main() {
    std::cout << "Hello, World!\n";
    return 0;
}

Build with: g++ main.cpp -o main && ./main

Find it in Zest

Search for “cpp hello world” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.

More C++ examples

All C++ examples