Posts

Showing posts with the label STL

STL(standard template library) - Iterations in C++

 Example of vector: #include<iostream> #include<vector> using namespace std; int main() { //sequence container  vector<int> v; v.push_back(10); v.push_back(20); v.push_back(40); v.push_back(50); v.push_back(22); v.push_back(10); cout<<"size => "<<v.size()<<endl; v.clear(); cout<<"size => "<<v.size()<<endl; return 0; } output: size => 6 size => 0