Repository navigation
Add a classic C++ Hello World example - #316
Open
sourcecode84 wants to merge 1 commit into
Open
sourcecode84 wants to merge 1 commit into
sourcecode84 wants to merge 1 commit into
Conversation
A self-contained program under examples/hello_world that compiles with g++/clang++ and prints a greeting to stdout. Includes a small Makefile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Build and run:
cd examples/hello_world make runOr without make:
Expected stdout:
Hello, World!Verified locally with g++ 13.3.0 (
make runexits 0).Files
examples/hello_world/main.cpp— Hello World sourceexamples/hello_world/Makefile—all/run/test/cleanexamples/hello_world/README.md— build instructionsexamples/hello_world/.gitignore— compiled binaryNo 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
-Wall -Wextra -Werror