Cpp_Notes
Cpp_Notes
1. Introduction to C++:
#include<iostream>
int main() {
return 0;
int a = 5;
float b = 3.14;
char c = 'A';
4. Operators:
- Arithmetic: +, -, *, /, %
5. Conditional Statements:
if (condition) {
// code
} else if (condition) {
// code
} else {
// code
6. Loops:
while (condition) {
// code
do {
// code
} while (condition);
7. Functions:
return a + b;
}
8. Arrays:
9. Strings:
class Person {
public:
string name;
int age;
void introduce() {
cout << "Name: " << name << ", Age: " << age;
};
class MyClass {
public:
};
12. Inheritance:
class Animal {
public:
};
public:
};
#include<fstream>
ofstream file("example.txt");
file.close();
#include<vector>
v.push_back(4);