Lesson 29: Arrays part 3. Beginning Programming with Visual Studio C++ 2010

preview_player
Показать описание

Last few things on the array.

You can ask me questions that i was not clear on and i will answer ASAP. Please provide complements and likes if the vid was good OR constructive criticism if they could be better or just flat out suck. I WILL edit or remake videos if they are horrible in certain areas or if they just flat-out suck and will take your feedback into consideration.
Рекомендации по теме
Комментарии
Автор

@bruceleeking1 basicly, it is an array of 3*3 int variables. Think of it as a grid. Instead of having 9 values on a line, you have 3 values on line 1, 3 on line 2 and 3 on line 3. It is stil 9 values in total

ThomasGhs
Автор

@D01299323 cause it is remembered like this: 0-0 is value 1 of block 1. 0-1 is value 2 of block 1. 0-2 is value 3 of block 1. 1-0 is value 1 of block 2. and so on.

ThomasGhs
Автор

pretty confusing stuff in terms of multi dimensional arrays but I think I finally got it. keys[3][3], okay so the first [3] corresponds to the block of code you are trying to access, and the second [3] corresponds to the number inside that block. E.g. int keys[3][3] = {1, 2, 3, *BLOCK 0 4, 5, 6, *BLOCK 1 7, 8, 9 * BLOCK 2} I want to access block 0 number 3, but how? Well, its block 0 so the first [3] becomes [0]. okay now im inside the right block. How about the number? Well number 3 has index 2. So second [3] is [2]. Therefore we have keys[0][2]! Hopefully that helps you out folks.

DavidAnatolie
Автор

@iam4eversmart88 can you plz explain why it was int keys[3][3] instead of [9]??

bruceleeking
Автор

in other programing languages that i've looked into (and partially learned), an array can contain an array, can arrays do that in c++?

TrinityGamer
welcome to shbcf.ru