The Hello World program is a minimal example of a working program. By tradition, this minimal example displays a text similar to 'hello world'. Goal of such a program is to see if the programming environment works.
Note that this example code is not standarized, so multiple and similar variants are on the Internet.
The code base of Hello World is:
#include <iostream>
int main()
{
std::cout << "Hello world\n";
}
- Avoid std::endl [1]
Here are some detailed examples of Hello World, depending on IDE and operating system:
- 'Hello World' using C++ Builder
- 'Hello World' using Qt Creator under Cygwin
- 'Hello World' using Qt Creator under Lubuntu
- 'Hello World' using Qt Creator under Lubuntu, crosscompile to Windows
- 'Hello World' using (a Windows version of) Qt Creator under Wine under Ubuntu
- 'Hello World' using Qt Creator under Ubuntu
- 'Hello World' using Qt Creator under Ubuntu for Android
- 'Hello World' using Qt Creator under Ubuntu for NDS
- 'Hello World' using Qt Creator under Ubuntu for Symbian
- 'Hello World' using a Windows version of Qt Creator under Wine under Ubuntu for Symbian
- '' using Qt Creator under Windows
More demanding examples are:
- Hello BigInt: tests if the BigInt libraries are installed correctly
- Hello Boost: tests if all Boost libraries are installed correctly
- Hello Boost.Lexical_Cast: tests Boost.Lexical_Cast
- Hello Boost.Regex: tests Boost.Regex
- Hello Boost.Signals: tests Boost.Signals
- Hello Boost.Signals2: tests Boost.Signals2
- Hello Boost.uBLAS: tests Boost.uBLAS
- Hello Boost.Xpressive: tests if the Boost.Xpressive libraries are installed correctly
- Hello C++0x: tests if C++0x can be used
- Hello C++11: tests if C++11 can be used
- Hello CLN: tests if the CLN libraries are installed correctly
- Hello GMP: tests if the GMP libraries are installed correctly
- Hello NAG: tests if the NAG libraries are installed correctly using C
- Hello Qt: tests if the Qt libraries are installed correctly
- Hello Qwt: tests if the Qt libraries are installed correctly
- Hello World (64-bit): compile for 64-bit systems
- Hello Wt: tests if the Wt libraries are installed correctly