Loading...
Search for a command to run...
Loading...
Slide 1 of 4
C++ is a powerful, compiled language offering both high and low-level programming.
g++ -std=c++20 -o program program.cpp
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
cout << "Hello, C++!" << endl;
string name = "Alice";
int age = 25;
double pi = 3.14159;
cout << name << " is " << age << " years old" << endl;
auto message = "Modern C++";
// Range-based for
vector<int> numbers = {1, 2, 3, 4, 5};
for (auto num : numbers) {
cout << num << " ";
}
cout << endl;
// nullptr
int* ptr = nullptr;
if (ptr == nullptr) {
cout << "Pointer is null" << endl;
}
return 0;
}