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

C++    |    Intermediate
  • 14 videos | 1h 37m 12s
  • Includes Assessment
  • Earns a Badge
Rating 4.5 of 26 users Rating 4.5 of 26 users (26)
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.

WHAT YOU WILL LEARN

  • 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

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

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

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.

YOU MIGHT ALSO LIKE

Rating 3.7 of 21 users Rating 3.7 of 21 users (21)
Rating 4.3 of 6 users Rating 4.3 of 6 users (6)
Rating 4.3 of 50 users Rating 4.3 of 50 users (50)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.1 of 10 users Rating 4.1 of 10 users (10)
Rating 4.2 of 46 users Rating 4.2 of 46 users (46)
Rating 4.5 of 53 users Rating 4.5 of 53 users (53)