Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
container access all elements
//g++ 5.4.0 #include <iostream> #include <deque> using namespace std; int main() { deque<int> test; for(int i=0; i<10; ++i) test.push_back(i); // index for(int i=0; i<test.size(); ++i) cout<< test.at(i) << ' '; cout<< endl; // iterator for(deque<int>::iterator i=test.begin(); i!=test.end(); ++i) cout<< *i << ' '; cout<< endl; // iterator with auto (C++11) for(auto i = test.begin(); i != test.end(); ++i) cout<< *i << ' '; cout<<endl; // foreach (C++11) for(int i : test) cout<< i << ' '; cout<< endl; // foreach with auto (C++11) for(auto i : test) cout<< i << ' '; cout<< endl; }
run
|
edit
|
history
|
help
0
BST to DLL
Listas enlazadas - merge
Kishan_Basic_Geometry
Working variables benchmark
CodeChef P2 - FIZZA
kadane's algorithm
IceCream
replace_copy_if-30-Seconds-of-C++
Palindromy
sortbyfrequency(hasing+sorting using comparator function)