C
C
advanced:
1. Introduction to C++
2. Basic Syntax
#include <iostream>
Int main() {
Return 0;
}
3. Data Types
Primary Types
Derived Types
User-Defined Types
Arithmetic: + - * / %
Logical: && || !
Assignment: = += -= *=
6. Control Statements
Conditional
If (x > 0) {
} else {
Loops
For, while, do-while
Cout << I;
8. Functions
Return a + b;
Class Car {
Public:
String color;
Void drive() {
};
Car myCar;
Encapsulation
Inheritance
Class Animal {
Public:
};
Abstraction
Class Person {
Public:
};
Int a = 10;
Int *p = &a;
Int &ref = a;
#include <fstream>
Ofstream fout(“file.txt”);
Fout.close();
13. Templates
Function Template
T add(T a, T b) { return a + b; }
Class Template
Class Box {
T value;
};
14. Exception Handling
Try {
Throw 5;
} catch (int e) {
16. Namespace
Namespace mySpace {
Int x = 10;
Operator Overloading