Lesson 1 of 45 · C++
Lesson 1: Introduction to C++
Duration: 8 min
Lesson 1 of 45 · C++
Duration: 8 min
cpp\n#include <iostream>\n\nint main() {\n std::cout << \"Hello, C++ world!\" << std::endl;\n return 0;\n}\n\n\nThis minimal program demonstrates:\n1. A preprocessor directive (#include <iostream>) that pulls in the I/O library.\n2. The main function, which is the entry point for every C++ executable.\n3. std::cout for writing to the standard output stream.\n4. return 0; signalling successful termination.\n\n> Tip: Compile with g++ -std=c++20 -Wall -Wextra hello.cpp -o hello to enable the latest language features and helpful warnings.\n\n---\n\n