C++ is a high-performance, general-purpose programming language widely used in system/software development, game development, and competitive programming. It combines the speed of C with object-oriented features, making it both powerful and flexible.
Here are free and lightweight ways to write and run C++ code on different devices:
sudo apt install g++This is a basic C++ program that displays Hello, World! in the output. Perfect to test if everything works:
// Simple C++ Program
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
Explanation:
#include <iostream> lets you use input/output functions like cout.using namespace std; avoids writing std::cout every time.main() is the entry point of the program.cout << "Hello, World!" displays the message.