Modernes C++ programmieren

Okt 23, 2024

lst-0302-book.cpp

// https://godbolt.org/z/ro6fdsvT9 
#include <vector>
#include <iostream> // cout
using std::vector; using std::cout;
int main() {
    vector data{ 12, 100, -1, 0,  };    // vector<int>
    for(auto& val : data)
        val *= 2; // verdoppeln
    for(const auto val : data)
        cout << val << " ";
    cout << "\n";
}