C++ Notes Styled
C++ Notes Styled
1. Introduction to C++
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!";
return 0;
}
3. Data Types
5. Operators
Arithmetic: +, -, *, /, %
Page 1
C++ Notes - Beginner to Advanced
6. Control Structures
If-Else:
if (x > 0) {
// do something
} else {
// do something else
}
Loops:
for, while, do-while
7. Functions
9. Object-Oriented Programming
class Car {
public:
string brand;
void drive() {
cout << "Driving...";
Page 2
C++ Notes - Beginner to Advanced
}
};
int x = 10;
int *ptr = &x;
int &ref = x;
#include <fstream>
ofstream file("data.txt");
file << "Hello!";
12. Templates
try {
// risky code
} catch (exception &e) {
cout << e.what();
}
Page 3
C++ Notes - Beginner to Advanced
- Lambda functions
- Smart pointers
- Move semantics
- Multithreading
Page 4