Control Structures in C++: Range-based for Loops

C++ 17    |    Intermediate
  • 14 videos | 1h 37m 12s
  • Includes Assessment
  • Earns a Badge
One of the many differences between modern C++ and classic C++ is the presence of range-based for loops. These were added to the standard in C++11 and allow for loops to iterate easily over a container and reduce the risk of off-by-one errors. They also eliminate the need for an integer index variable to index into a container. Start this course by reviewing how for loops work to iterate over arrays. Create arrays with different numbers of dimensions and iterate over the dimensions using nested for loops. Discover how to use containers from the standard template library to experiment with maps and vectors. Explore the use of the cbegin(), cend(), rbegin(), rend(), crbegin(), and crend() functions. Finally, use range-based for loops and explore the use of the debugger in this context. You will also note the important differences between value type loop variables in for loops and reference type variables.


  • discover the key concepts covered in this course
    iterate over arrays using for loops
    create string arrays and use break and continue
    create multidimensional arrays and iterate over them
    recall the offerings of the standard template library
    access out-of-bound elements and create iterators
    search for an element in a vector through templates
  • use the cend(), rend(), and crend() functions
    build and debug code
    debug code using a build
    walk through code using a debugger
    contrast strings and string references
    use maps and range-based for loops
    summarize the key concepts covered in this course


  • 2m 7s
  • 8m 38s
  • Locked
    3.  Using the Break and Continue Keywords
    5m 50s
  • Locked
    4.  Iterating over Multidimensional Arrays
    7m 10s
  • Locked
    5.  Understanding the STL
    9m 38s
  • Locked
    6.  Accessing Out-of-bound Elements of a Vector
    7m 2s
  • Locked
    7.  Searching in a Vector Using Templates
    6m 17s
  • Locked
    8.  Using the cend(), rend(), and crend() Functions
    9m 13s
  • Locked
    9.  Debugging C++ Code
    8m 48s
  • Locked
    10.  Configuring the Debugging of Code
    5m 45s
  • Locked
    11.  Using Debuggers to Play the Execution of Code
    9m 27s
  • Locked
    12.  Using String References
    6m 15s
  • Locked
    13.  Creating Range-based For Loops
    7m 57s
  • Locked
    14.  Course Summary
    3m 6s


Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.