Skip to content

Add a classic C++ Hello World example - #316

Open
sourcecode84 wants to merge 1 commit into
regnull:mainfrom
sourcecode84:feat/cpp-hello-world
Open

sourcecode84 wants to merge 1 commit into
regnull:mainfrom
sourcecode84:feat/cpp-hello-world

Conversation

@sourcecode84

Copy link
Copy Markdown

Problem

The repo had no trivial C++ starter that a standard compiler can build and run. This adds a classic Hello World so a greeting can be printed to stdout with g++/clang++.

Solution

A self-contained example under examples/hello_world:

#include <iostream>

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

Build and run:

cd examples/hello_world
make run

Or without make:

g++ -std=c++17 -Wall -Wextra -Werror -O2 -o hello_world main.cpp
./hello_world

Expected stdout: Hello, World!

Verified locally with g++ 13.3.0 (make run exits 0).

Files

  • examples/hello_world/main.cpp — Hello World source
  • examples/hello_world/Makefile — all / run / test / clean
  • examples/hello_world/README.md — build instructions
  • examples/hello_world/.gitignore — compiled binary

No application code, Python, or TypeScript is changed. The example sits beside other non-app samples under examples/ and does not affect backend/frontend CI jobs.

Notes

  • C++17, -Wall -Wextra -Werror
  • Do not merge until review/QA sign off

A self-contained program under examples/hello_world that compiles with
g++/clang++ and prints a greeting to stdout. Includes a small Makefile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants