Introduction to C++

Hello World in C++

Your First C++ Program 🎉

Let's write a simple "Hello, World!" program.

The Code

#include <iostream>

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

Breaking It Down

PartMeaning
#include <iostream>
Include I/O library
int main()
Main function (entry point)
std::cout
Standard character output
<<
Output operator
std::endl
End line and flush
return 0
Program ended successfully
Visualizer
$ g++ main.cpp && ./a.out
Hello, C++!

Interactive Visualization

c
Loading...
Output
Run execution to see output...