Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Arrays mit vector ====== <code c++> #include <iostream> #include <vector> using namespace std; int main() { vector<int> v; v.push_back(3); // [3] v.push_back(2); // [3,2] v.push_back(5); // [3,2,5] for (int i=0; i<v.size(); i++) { cout << v[i] << ","; } cout << endl; // Ohne Index: for (auto x : v) { cout << x << '\n'; } } </code> lehrkraefte/blc/informatik/ffprg2-2024/cpp/vector.txt Last modified: 2024/09/23 11:15by Ivo Blöchliger