Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
samp error
11933
Float
11
Dar
C++ Solar eclipse program(Shoushi integrated) 1568 - 1644 also check Lunar eclipse for Xing Yunlu
Coin changes
return reference (gcc)
typeid
RegexReplace
Please log in to post a comment.