Lesson 36 – Arrays and Loops

This lesson looks at arrays and loops in C#. An array stores a collection of variables – of the same type – within a single variable while a looping statement can be used to iterate through that collection and perform operations on each item or return each item’s value. The most versatile looping statement in C# is the for() loop, which comes with a built-in counter and conditional evaluation. We also look at a simplified looping statement that works particularly well with arrays called foreach() and use it to solve a graphical issue in our “teleport” animation.

Members Only Content (Source Code, Quiz, Q&A)

This content is for Extended Support Package members only.
Log In Register