Aug 24, 2024
include <iostream>
for input/output operations.int main() {
// code
return 0;
}
std::cout
for output and std::cin
for input.int
, double
, char
, boolean
, and string
.int x = 5;
double price = 10.99;
+
, -
, *
, /
, and %
(modulus).&&
(and), ||
(or), and !
(not).if
, else if
, and else
for conditional statements.returnType functionName(parameters) {
// code
}
int
, void
, etc.class Car {
public:
string make;
string model;
void drive() { /* code */ }
};
class Child : public Parent {
// child class code
};
*
to declare a pointer and &
to get the address of a variable.int* ptr = &x;
new
operator and should be freed with delete
.int* array = new int[size];
delete[] array;