The "Hello World" program for C++ beginners with explanatory comments and support files including documentation and useful links.
The classic source code, despite its brevity, clarifies the basic structure of a C++ program.
The extended source code covers additional issues such as copyright, licensing information, user interaction, etc.
The support files will help to understand the project structure relatively to Open Source Community standards and conventions.
Copyright (C) 2021 Dr. Nord
Table of contents
Generally, to be able to build an executable from a source code it is recommended to install an IDE. Consider using Code::Blocks - the free C/C++ and Fortran IDE. Be sure to install the IDE's binary release with a compiler (that is the MinGW-W64 compiler if you are on Windows).
Using an IDE is not mandatory. It is absolutely possible to install a bare compiler, such as GCC and do the compilation from a command line.
In this case usage of buld tools, such as GNU Make is recommended. A file makefile is included to this project for such a purpose, you may simply type make
from the project folder and the GNU Make will do the rest.
For extended version you can use the file makefile-x ('x' stands for 'extended'). In this case it is needed to explicitly specify the filename 'makefile-x': make -f makefile-x
.
Follow the steps below to see the "Hello World" in action:
- Place the main.cpp file somewhere on a local drive. For extended version you can use the file main-x.cpp ('x' stands for 'extended').
- Compile it (see Prerequisites for details).
- Run the obtained executable. If you are executing the classic version and don't see any effect (the console window may be opened and closed instantly giving no opportunity to see the displayed text), try executing it from a command line. You can do the same with the extended version to catch the output, printed before exiting the program.
Only the source code file main.cpp or main-x.cpp is used, no installation is needed.
The rest files are supportive and represent formal attributes of a complete project.
Also you may find useful the Git commands memo for this repository
Usually the obtained executable size is reduced by means of dynamic linking of some libraries, not obligatory included to every operating system's software. To ensure your executable launchability consider compiling it using static linking (look for example in the file makefile).
Please read CODE-OF-CONDUCT.md and CONTRIBUTING.md for details respectively on the code of conduct and the process for submitting pull requests.
The SemVer is used for versioning. For the versions available, see tags on this repository.
Supervisor, chief executive: Alexander Nord, aka 'Dr. Nord' - Doctor of Engineering Sciences, Professor
📧 [email protected]
https://github.com/DrNord
This project is licensed under the GNU General Public License - see the official site GNU GPL v3.0, SPDX-GPL-3.0-or-later or local-license-GPL-3.0-or-later file for details.
You can still use the previous release v1.0.0 under its MIT License.
Some specified content of the .gitignore file is taken from C++.gitignore, that is published under the CC0 1.0 Universal license, its text is also placed here: CC0-1.0.
Inspired by those who strive for everything from nothing.
Take the time to explore additional files, you may discover useful links there (thanks to its content authors).