Sep 11, 2024
#include <bits/stdc++.h> to include all libraries at once.using namespace std; to avoid prefixing with std:: for standard functions.void print() {
cout << "my name is Raj";
}
int sum(int a, int b) {
return a + b;
}
.first and .second to get the elements in a pair.pair<int, int> p = make_pair(1, 3);
cout << p.first; // Outputs 1
cout << p.second; // Outputs 3
vector<int> v;push_back() or emplace_back() for adding elements.v[i] or v.at(i).for(auto &val : v) {
cout << val;
}
size(), pop_back(), clear(), swap(), empty().push(), pop(), and top() operations.push(), pop(), and front() operations.insert(), find(), erase(), count().map[key] syntax.sort(begin, end) sorts the entire range.__builtin_popcount() for counting set bits in an integer.