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
In this video, we are going to proceed with the operations on two dimensional arrays, so suppose that
you have declared a two dimensional array like this and Matt and two rows, three columns, and instead
of initializing it with some arbitrary values that you've decided, you want to feel this table with
values received from the user.
You simply want to get all the two dimensional array values as inputs from the user.
So how would you do it?
The first step in doing so is understanding the fact that we are going to use our famous SCANA function.
That's the first step.
The next steps are very easy and very similar to the way we did it with one dimensional arrays, with
one dimensional arrays to put an input from the user to a specific element in this array.
We just specified the address of the desired element in this area.
Right.
So the same goes here with the two dimensional arrays.
Basically, since we know that our two dimensional array or as we sometimes refer to it as a grid of
rows and columns, it's just a bunch of sequence, the elements sitting somewhere in the memory.
So to feel a specific element with a value received from the user, we just need to specify the address
of these desired element where we want to store the input.
So if, for example, we want to store it inside of the first element, which is it row zero and column
zero, you just specify the element itself and then you use this kind of function, add the ampersand
and read the value to a given location.
So nothing complicated.
Geisen for example, here we received seven from the user and basically also if we wanted to get all
the elements for a given two dimensional array, then in this case what we have to do is to do some
sort of iteration into iterate over all the rows and all the columns at each row, and very similar
to the example that we've seen how we can print all the values here.
We can read OK from the user, every one of these values by using this kind of function.
And just a quick side note to remind you guys why we're using the percentage D here, OK?
And that's because we defined an array of integers.
But that's definitely should be clear by now.
OK, so the percentage these because we we are using in a an array of integers and if we were using
an array of loads, let's say it will be percentage F and so on.
You got the idea.
I shouldn't remind me so much.
But still for those of you who forgot how it can be used and how it should work.
OK, so you filled your array pretty simple by using this loop.
Iterate over all the elements of the array and you are reading the input from the user.
Pretty awesome.
So we talked about the percentage, the and what else remains for us to do is basically if you just
the second example, if you would have defined an array of doubles, then you simply would have used
this kind of percentage alef.
But that's nothing complicated.
And I think you already know this much at this point.
So what I suggest you guys do right now is to give it a try on your own, stub this video and write
this simple program that gets input from the user and insert these inputs inside of these two dimensional
array that you've just created.
Also, once you are done with that, make some task, then print the values, just like we've done it
in one of our previous exercises and make sure that the input values that you've used correspond to
the values that you can see printed on the screen.
So basically that there is a correlation between the values you've inserted using your keyboard and
the values that you can see printed on the screens.
And yeah, this is it for these video guys.
I don't have anything else to add here.
A quick video where we discussed something very, very simple is just how to read inputs from the user
and store them inside a given element in our two dimensional arrays.
So thank you and a.
I'll see you in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.