File Streams in C++ read from a file and Write to a file

https://youtu.be/WiZW58Hzt9A?si=BMVrM0xJLcX-k-Sm #include <iostream> #include <fstream> #include <string> using namespace std; int main() { fstream fStream{"read.txt"}; string line; while (fStream) { getline(fStream, line); cout << line << endl; } fstream f{"read.txt"};…

Exceptions in C++

https://youtu.be/ElTUlUHgUi8?si=YqGj4VAfyPaRssBm #include <iostream> #include <memory> using namespace std; int main() { try { int i = 50; throw i; } catch (int ex) { cout << "An integer exception :…

Shared Pointer in C++

https://youtu.be/EYPQxG_0O_k #include <iostream> #include <memory> using namespace std; int main() { shared_ptr<int> ptr1 = make_shared<int>(900); shared_ptr<int> ptr2 = ptr1; shared_ptr<int> ptr3 = ptr1; cout << "Shared pointer 1 : "…