Control flow

Introduction

Introduction

same as c, also have foreach to iterate over arrays


    int vals[] {1, 2, 3, 4, 5};

    for (auto val : vals) {

        std::cout << val << std::endl;
    }

can use this over strings
  for (char c : str)
  {
    cout << "[" << c << "]";
  }