All language subtitles for 11. Static Array of Structs

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

What is going on, guys?

I hope you are doing great.

Any of these video what we are going to talk about is basically how we can work with static arrays and

making sure make sure the camera is OK.

Yeah, I think it is.

And so we are going to work with static arrays of different structures and in this case, particularly

with a point struct.

OK.

So what we are going to do, first of all, we know that we can create some standard variable, right?

There is no problem.

We we know how we can write down point b one.

And that's how we create a point variable that is called P1.

But there may be times just like we've done it within the juris right that there was Int Nam, but we

wanted to create an array of integers or an array of floating point numbers, an array of characters.

Similarly, we can do the same pretty much by creating a static array of the user, a defined structure

that we've created.

So in this case, we have created a point structure with the two fields in Ekes and in white oak and

the name of the structure, the name, if we want to create at this point.

So whenever we will use point, it will specify the type of the integer that we wanted to create.

But now we want to see how we can create an array of points.

So in this line 37, we create a static array of points with a size of five.

So if we will take a look behind the scenes, how it will look like, it will be something like that.

OK.

So let me try it for you.

So one, two, three four.

And let's add the fifth one.

OK.

So zero, one, two, three and four.

These will be the point.

Points array.

OK.

Of size five.

And now what I want you to take a look is that understand that each of these elements is now basically

representing a variable of type point.

So that means that here will be the X value and here will be the Y value, and the same will go for

each and any of the elements inside of this array.

OK.

So each of the elements that can be accessed by using the index.

OK.

These are the indexes index.

Each of these elements is going to have two members X and Y.

And why do we have just two members?

Because that's the type that we've created, and based on this type, we have only two members.

If there were additional types or basically another struct, so the members there war basically referred

to or related to the structure itself.

OK.

So we have an array of points called Points Array, its size is five, and we can access each and any

one of its elements.

So let's try to basically just access.

Let me get another color.

Let's try to access just this element into store inside of the field x some value on inside of the field

of white and other value.

So how basically should you do it?

You should print some message to the user saying, please enter a first X coordinate and then what you

are going to do is simply to read this information and store it inside some variable, right?

So the main step here is to understand the structure of accessing a certain element in the array and

then accessing a certain field inside of this certain element.

OK, so first of all, what we will do is we will say that Point's array is just the name of the array

and it will help us to access different fields inside of it.

So points array at index zero.

All he does is returning.

You kind of this block.

OK.

And what is the type of these block?

It's types of a point.

Right?

It's a point because these these in array of points, five elements of point type.

And we know that each element has the following members index and entwine since it's a point so we can

use the DOT to access the X field.

So once we use the DOT, what we specify is that we are currently looking at.

Come on at this region at these variable X.

OK.

After points array, it's index zero gave us all of this and data X gives us this specific X right here.

And then, of course, because that's the syntax of this kind of function.

We use the ampersand to specify store it inside the address of fix.

And then we put some value here, let's say three, and then we repeat this process and do pretty much

the same by accessing and storing the information inside of the Y member at Points Array at Index zero.

So we store here five.

OK.

That's it, that's all that we do, X and Y storing it three and five.

OK, so let's basically run this program and make sure that so far it works exactly as we expect.

For now, let's simply comments out this blog, because that's the next part of what's come again.

No, no, no.

That's the next part of our editorial.

Now, let's run it and hope for the best.

OK, so there you go.

We don't need the here.

Come on.

Let's run it.

Let's run it.

What's going on?

OK, so and there a first point x coordinate, let's say, three.

That's point also will say that let's use five and basically now we cannot see it right now, but basically

behind the scenes, all that happened is we simply storing the value we specified in this box and the

value was specified in these white.

That's it.

OK, so far, so good.

Awesome, so we can move on to the next part, and this next part is basically referred to understanding

that we know how to access.

We know how to access a specific element inside of this array.

And now what we are going to do is to iterate over all of the point array and reading input into each

of them.

OK, and getting, let's say, getting getting input into each of them.

So we'll use a simple and standard for loop.

We will use for our equals to zero as long as I is less than five C++, meaning five iterations on every

iteration.

We are going to ask the user, please answer some point, OK, which point point I'm just using here?

These are sine and percent that will be replaced with the value of eight plus one.

And the reason why I'm using here I +1 is because I want to ask the user entry point one entry point

two and not to start with entry point zero because the first element of I is going to be zero in the

first iteration.

That's not what I want.

I want to make it, not by the values of the indexes, but rather by some more standard values from

one up to five.

And then what we are going to do is to access a specific element inside of this array.

Which depends on the high index.

OK.

And once we access a specific element, we will be able to access a specific member inside of this element.

OK, so we know that Point's array, its index site, is of a point type and we can access.

We know that a poison type is defined by two fields in these example intakes and in Y.

And we can access each of these fields and then to use the jumper to specify that we want to store inside

of these address of the specific member.

So all of these function is going to do is just to read from the user five X values and five Y values

and store them accordingly inside of these points of rate.

OK.

And once we stored all of this information, OK, and by the way, once again, it doesn't have to be

just in the jurors, it can be a float, it can be a double and can be a char.

There is nothing, nothing about it.

I'm just using a simple example to make the whole.

Process of thinking and learning these concepts to be as much easier as possible.

OK, so if we used here is something else.

So for example, we used, I don't know.

Some float, so instead of percentage, they simply use percentage and for percentage allow for a percentage

see based on the phenotype that you are working with.

OK, nothing so difficult.

Awesome.

So after this point, we have our whole array.

These guy right here are filled with values.

So we can move on.

And we can access and print all of these values basically one by one, and we can access and print the

values of each of the static array of points.

And how should we do it?

Once again, we need to iterate over all the elements.

There are five in this example.

We need to iterate over all the elements of this array.

And accessing each of the elements and inside of the each of the elements, we need to access each of

the members inside of these element in these gates.

The point elements so point percentage, the first point we will use here plus one, just like previously

explained, equals in higher percentage will be replaced by points or at index.

I don't x and by points a rating distinct Y grades simply accessing the members of a certain element

in disarray.

And the reason why we don't want why we do not use ampersand here as opposed to scan.

If it's because we want to print the value of the the variable itself, right?

We don't want to print basically the address.

We are not interested in this point, at least.

OK, so let's simply comment these marked out and let's run and hope for the best.

Let's see what happens.

So enter point one x coordinate.

Let's use one.

What happened?

I pressed something wrong.

OK, so let's try it once again, sir.

One.

And let's use and 3.1.

OK.

X and Y inside of the first point are going to be one and one.

In the second point, they are going to be two and three in the third point.

They are going to be one in five in the fourth, let's say, five and five and nine and nine.

And finally, we can see that point number one equals two one one one one point two two to three point

three to one five point four to five five and point five to nine nine.

So what it means is basically this whole array is store and is probably a sequence of bytes in memory.

OK?

A sequence of bytes and each element is also kind of a sequence because it's by self destruct.

So there are going to be like in this example, let's say, in the jury's four bytes.

So there are going to be four bytes for X, four bytes for why?

And that's basically the first element.

And then there are going to be four bytes for X, four bytes for Y and so on, and for the second element

and so on and so forth.

You move on with the array itself.

OK.

Who?

So I hope this is clear so far and that everything that I explain to you is getting more and more clearer.

It's uncomment everything that's basically the program that we've created.

Now we have created, you know, a structure point.

We created a static array of points.

Very similar to how we created an array of integers in a way to float.

We also created, we've shown we've seen how we can access a specific member in a specific element in

the array, how we can scan F and write the information into it while it's used instead of reading was

writing.

And then we've seen how we can iterate over all the elements, read inputs, right inputs into each

of them, and then to access and print all the values inside of these elements.

So yeah, this is it.

Thank you guys for watching.

Keep on practicing.

Keep on moving forward and you are bound to succeed.

Let me know if you like this video and the material so far.

Please also feel free to leave some reviews, some feedback, some star rating.

It helps me a lot in improving the course material that it will be more optimized for you.

Thank you.

And until the next video, I'll see you then.

Bye.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.