std sort function in C++

https://youtu.be/nq_8aNhxfTs #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> v1 = {1, 6, 2, 5, 10, 4, 11, 3}; sort(v1.begin(), v1.end(), greater<int>()); for (auto el…

std map in C++

https://youtu.be/79s8gkLF6Y8 #include <iostream> #include <map> using namespace std; int main() { map<int, char> m = {{1, 'A'}, {2, 'B'}, {3, 'C'}}; for (auto el : m) { cout << el.first…

std::vector in C++

#include <iostream> #include <vector> using namespace std; int main() { vector<int> v = {4, 5, 6}; v.push_back(7); cout << v[0] << endl; cout << v[3] << endl; cout << "The…

String Streams in C++

https://youtu.be/6WIevcEVBqY?si=xM945G9koO3GoEe3 #include <iostream> #include <sstream> #include <string> using namespace std; int main() { stringstream sStream{"Hello World!"}; cout << sStream.str() << endl; stringstream ss; ss << "Hi There"; cout << ss.str()…