As you might have noted in previous chapter projects, sometimes creating loops within your applications allows you to repeatedly perform certain steps. Loops are an essential part of computer programming. They often allow you to compact what would otherwise be a large and messy number of duplicate programming statements into a few clean lines of code. Loops are a great option for processing the contents of arrays and controls, such as the ComboBox, which store collections of data. In this chapter, you learn how to use a number of Visual C++ statements to create different kinds of loops. In addition, you get the chance to apply what you learn through the development of the chapter's game project, the Dice Poker game.
In this chapter, you learn the following:
How to create do...while loops
How to create for and for each loops
How to create while loops
How to use variations of the break keyword to break out of loops
How to guard against endless loops