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.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this courseiterate over arrays using for loopscreate string arrays and use break and continuecreate multidimensional arrays and iterate over themrecall the offerings of the standard template libraryaccess out-of-bound elements and create iteratorssearch for an element in a vector through templates
-
use the cend(), rend(), and crend() functionsbuild and debug codedebug code using a buildwalk through code using a debuggercontrast strings and string referencesuse maps and range-based for loopssummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview2m 7sUP NEXT
-
2.Introducing Arrays and For Loops8m 38s
-
3.Using the Break and Continue Keywords5m 50s
-
4.Iterating over Multidimensional Arrays7m 10s
-
5.Understanding the STL9m 38s
-
6.Accessing Out-of-bound Elements of a Vector7m 2s
-
7.Searching in a Vector Using Templates6m 17s
-
8.Using the cend(), rend(), and crend() Functions9m 13s
-
9.Debugging C++ Code8m 48s
-
10.Configuring the Debugging of Code5m 45s
-
11.Using Debuggers to Play the Execution of Code9m 27s
-
12.Using String References6m 15s
-
13.Creating Range-based For Loops7m 57s
-
14.Course Summary3m 6s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.