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
Segmented Sieve
StackPat
CPP - Arrays - Ex.1
TmpFib
Aplicatie-Proiect
Wipro Problem 2: determine count
LRU - Main
P1
teste
data locality - slow example