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
OK, so in this video, we are going to talk about the declaration of two dimensional arrays, and the
first thing we usually learn when working with different data types is how to declare them.
And by saying how to declare them, I actually mean, how can we make our computer be aware that they
really do exist?
And that's actually very similar to working with boxes.
We first need to know that these boxes do exist before we can use them and I don't know, pecc something
inside of them.
Right.
So the same goes for our lovely computers.
And the first step that we have to make is to declare exactly what we are going to work with.
And once we do so, the computer will first of all know that it exists OK, and that what we we've created
and what we want to use it actually exists.
So then we can work with it however we like and do all the things that we want to do with the design,
bring the value to the screen, getting reading the the inputs from the user and whatever comes to your
mind.
So I hope the reason for why we need declaration is clear to you, as it already should be clear to
you by this point.
That's for sure.
And as a quick reminder, I want to talk about the standard variable in how we use the declaration for
them.
And basically we had some simple following our syntax.
So, for example, we had int num and double B and char my char and whatsoever.
So we had the the name of the variable, which in the first line is just num, we had a type which is
integer.
And basically what we have created behind the scenes is a simple box labeled as num with type int in
other examples, whereas you probably can see here on the screen is just double B, OK, so we created
a variable called B, OK, that's its name and its type is double in charge of my char and so on.
Right.
That, that's how we have been working with the declaration of standard variable so far in later on.
What we've done is that we have been working and declared a one dimensional arrays and what we've used
was something like this ain't grades.
And in the square brackets we use just the number of elements that we wanted this array to have.
So Ingres of size five simply created us an array of integers of five integers and its name was grades.
Also, we've we can do the same for any type like double char and so on.
And just what I want to show you guys before we move on is only how the declaration of one dimensional
array looks like OK, behind the scenes if we try to understand all the logic behind it.
So first of all, you specify the type of the one dimensional array.
Think of it as just one row of elements.
Then you specify its name and finally you specify its size.
And basically what it gives you is just a sequence, a row of elements of an initialized element.
We just declare them.
And basically, that's all.
What I wanted to r like to recap and now we are ready to like to move on and to talk about how we can
declare our two dimensional arrays.
So we recall that when we have been working with one dimensional arrays, it was like just working with
a single row of elements of the same type.
Right.
Just like we've done it with the int grades.
OK, so it's an array, a sequence of elements and each element is of an integer type.
And also you do remember that we talked about that are two dimensional arrays are simply like greed's
of rows and columns.
So if we are going to work with the greed of rows and columns, we've got to like to specify the size
of the number of rows and the number of columns.
OK, so in one dimensional arrays, we just specified one thing.
OK, so what is the length of these rows?
So basically how many columns does one dimensional array has and here what we are going to spend.
Fi is simply both how many rows are we have and how many columns we have and for that, whenever we
declare a two dimensional array, we will simply specify the size rows and columns, just like I said,
and it will look like this.
So first of all, you specify the type of the two dimensional array.
OK, just like you've done it with one dimensional arrays, then you specify its name.
OK, so there you go.
Here you have its name.
Then afterward, you specify the number of rows that we are going to use and the number of columns that
we are going to use.
So in the first bracket, we are going to specify the number of rows.
OK, and it may be, for example, three rows and four columns.
OK, so this will create a simple two dimensional grid.
OK, with three rows, as you can see here on the screen and four columns.
Pretty awesome, right?
I mean, there's nothing complicated here, right.
So basically we just are create the number of rows, specify the number of rows, the number of columns,
and there you go.
You get yourself a two dimensional representation and you can see the number.
Let's call it specified here.
You can see also the numbering of each of the rows and each of the columns.
OK, so it's just like an index.
And the numbering here also starts from zero up to the number of rows, minus one.
So zero one two because we have three rows.
You can see just that.
We start from zero and the same goes for a column from zero to three because we have four columns and
regarding how we can access each of the elements and how we can work with each of the elements of these
two dimensional array, it will be pretty much similar to how we can work with one dimensional arrays,
how we have been working with one dimensional arrays.
But that's something that we will cover in the next videos, because for now, I just wanted to show
you how these grid, how these two dimensional array looks like in our programming language.
And basically what I wanted to say to you guys is that this declaration, OK, that we've just created,
we are specifying to the computer with what exact grid we want to work.
So where we will be, where it may be very useful.
OK, so if you wanted to like to play a tic tac toe with some one of these little nice game with X's
and zeroes.
So in this case, you should also specify some greed, OK, maybe three by three or four by four and
maybe even ten by ten.
There is no problem for that.
Right, because if if you have memory to declare it, you can use applications to work with it.
And that's just one example of where these two-dimensional arrays are useful.
Also, think about Excel sheets.
OK, I'm just it's just the overview of the above overview of Excel sheet.
But yours you can see if you've been working with pixels, that you have rows, you have columns, and
it's also some sort of two dimensional grid and two dimensional array.
And basically there are actually a couple of cool things that you can do with Excel.
So get programmatically.
You can just like connect to it into reediting to your two dimensional array of data into like processes
using our programming language, although in our programming language specifically that we learn in
these course, it's not something that is very common, but it's important that you will know that this
thing is also possible.
Who so this is easy for these video guys.
This was a super important video.
I think that's a nice start and a nice and clean introduction to two dimensional array in our C programming
language.
So thank you guys for watching.
And let's move on.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.