Modernes C++ programmieren

Okt 20, 2024

lst-0021-book.cpp

// https://godbolt.org/z/1WG8zvhYe 
#include <vector> 
#include <iostream>                               // cout, endl 
int main() { 
  std::vector qus{1,4,9,16,25}; 
  for(auto it = qus.begin(); it!=qus.end(); ++it) // between begin() and end() 
    std::cout << *it << " ";  // with *it you get from the iterator to the element 
  std::cout << std::endl; 
}