Hello World in C++
Copy and paste this C++ Hello World example into your editor, compiler, terminal or runtime.
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
About this C++ example
Hello World programs are commonly used to confirm that a programming language environment is working correctly. This example gives you a simple starting point for C++.
The History of C++
C++ has an interesting history and continues to be used by developers, students and organisations around the world. The language was created to solve specific technical challenges and has evolved over time through new versions, tools and community contributions. Depending on the language, it may be used for business software, web applications, scientific computing, systems programming, education or specialist industries. Learning about the origins of C++ helps provide context for how it is used today and why it remains relevant. Many people begin their journey with a Hello World in C++ example because it provides a simple introduction to the syntax and structure of the language. From that first program, developers often progress to larger projects and gain a deeper understanding of programming concepts. Although technologies change, C++ continues to be an important part of the software development landscape and remains a valuable language to learn.
What is C++ used for today?
C++ is used today for high-performance software, game engines, financial systems, desktop applications, browsers, trading platforms and systems where speed and control are important. It extends many ideas from C while adding object-oriented programming, templates and a large standard library. A Hello World in C++ example usually introduces iostream, std::cout and the main function. These ideas give beginners a first look at how C++ handles program entry points and output streams before moving towards classes, memory management, templates and larger applications.
Why learn C++?
Learning C++ is useful for developers who want to build fast, complex and highly controlled software. It is especially valuable in industries where performance matters, including games, simulations, finance, engineering and large-scale desktop applications. Writing a Hello World in C++ program introduces the basic shape of a C++ application and prepares learners for topics such as classes, objects, templates, references, memory management and the standard library.
Explore more Hello World examples
Continue learning with more beginner-friendly Hello World examples in other programming languages.