C++ is a general-purpose programming language created by Bjarne Stroustrup that combines the speed of the C language with object-oriented features like classes, objects, and inheritance. Thanks to its speed, memory control, and ability to work close to the hardware, it's widely used in operating systems, game engines, browsers, trading systems, robotics, and other performance-heavy software.
#include <iostream>
int main() {
std::cout << "Hello from C++!";
return 0;
}In this code, #include <iostream> brings in the library needed for output. main() is where the program starts running, and std::cout prints text to the console. return 0; tells the operating system that the program finished successfully.
Hello from C++!Info
Most C++ statements end with a semicolon ;. Forget it, and you'll trigger a compile error — basically C++'s classic welcome party.