C# Programming: Lesson 9. Array Variables

Поділитися
Вставка
  • Опубліковано 5 лип 2024
  • This is the ninth in a series of computer science lessons about programming with C# for beginners. In this lesson you will be introduced to array variables. You will learn how to declare an array of strings and how to assign values to the elements of an array. You will also learn how to access the individual elements of an array by means of their index numbers, and how to avoid index out of range errors. It is helpful to visualise what is going on inside a computer’s memory when a program that makes use of arrays is running. You will therefore see how an array variable is assigned a group of contiguous memory locations by the operating system. The real benefit of programming with array variables is the ability of a programmer to access each element of the array, one after another, by means of an iteration construct. In this lesson you will learn how to scan an array by means of a for loop, or by means of a with a while loop.
    Chapters:
    00:00 Regular variables and memory
    02:32 Limitation of regular variables
    03:22 Declare and assign values to an array
    03:45 Arrays and memory
    04:55 Access an element of an array
    07:42 Scan an array with a for loop
    08:17 IndexOutOfRangeException
    10:11 Scan an array with a while loop

КОМЕНТАРІ • 4