Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
All right, so now that you know how to declare in, initialize a two dimensional array, you want to
know how to access each of its elements.
So to understand how it is done with a two dimensional array, we first need to recall how it was done
with just one dimensional array.
So suppose you had a one dimensional array that was defined as following into error of three elements
in each of them equals two and the elements equal to one, two, three.
So in this case, you should access any of the three elements within this array by just using the indexing
thing that we've learned simply to access the first element of the array.
We could just use a R at Index zero and to access the second element, we could use ARRL Index one and
so on.
We also do remember that a one dimensional array can be considered as just a row of elements and that
a two dimensional array can be considered as a grid of rows and columns or just a bunch of rows.
And if we said that a one dimensional array can be considered as just one row.
So when we access some elements, we are some element within these array, as we did previously.
We specify just the column number of these one row.
So just like we you can see here on the screen with this little nice examples.
So when we did our ARRL Index two, we told our computer to get the third element of this one dimensional
array, meaning the value add of a third column of these array.
Basically, as you probably guessed, when we want to access some element in the two dimensional array,
we need to specify also the exact row, as well as the exact column that we want to access.
And for example, let's say you had these following two dimensional array.
So its name is Matt and it has two rows, three columns, and it's basically filled in the standard
way of initializing.
And we can basically hear or see the representation of these two dimensional array.
And we can see that also we have the indexes for the rows and for the columns and it rows zero and column
one.
OK, or let's start with row zero and column zero here.
Let's use this little nice laser.
Come here.
OK, so you have here this little nice lizarazo column zero and row zero, and it gives you the value
of one.
And also you can see.
Let's move on.
What are these.
Oh, OK.
So mad at row zero and column zero.
Its value is one.
So that's how we access this element in this array.
And basically that's the whole point of how you access any of the elements in disarray.
So Matt and the index are zero one it row zero.
First of all, you specify the row and then you specify the column.
So method zero zero.
Index one zero zero.
Index one, that's how you go.
The values two, three, four or five, six doesn't really matter.
So basically you can like to access each of these elements and to do whatever you like with them.
So now let's see a couple of examples of how it will look like in code so and in the same way also can
be done for any other of the elements.
OK, so at row one and column two, you will simply go like row one column to change these value to
twelve.
And there you go.
You axis the given element, modified its value and it was changed to twelve.
And now basically that you know how to hexis each element and to change you directly, you can use it
also to your advantage and simply print the value to the screen.
Basically, you can print any of the elements of these two dimensional array using the printed function.
So here it is.
Are the changes that once you've executed each of these lines, the changes that were made inside of
these two dimensional array, and also if you would like to access into print the value.
So, first of all, you know how to access.
There is no reason why you won't be able to print.
These values, if you can access them, you can change them and you can print them.
So this is it for these video guys.
I think we've covered everything regarding the basics in the last two, three videos, the basics of
the two dimensional arrays.
It took us a little bit more than when I was planning to, but I decided to go like, you know, to
to go with you step by step, because for some reason, a lot of students are struggling with this understanding
of how to use the rows and the columns together.
They know how to use for one dimensional array, but they find it.
I don't know why they find it a little bit hard to work with two dimensional arrays.
So I decided to give it some extra time and to talk about more, more in depth about the declaration,
about the initialization, and also about how to access into print and to modify each of the two dimensional
arrays values.
So thank you for listening.
Keep on practicing and I'll see you in the next video, as always.
Have a nice day, guys.
Goodbye.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.