All language subtitles for 15. Mathematical Operators - Writing Associate Functions

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

So one of the questions that may arise after working with the previous relational operators is what

will happen if we will try to use some mathematical operations on structs.

So we know that if we create some variable, some standard variable income equals two five, we can

write down nonplused plus.

And that's it, it will simply increment the value of number one.

And we can also ride down nonplused equals to three, it will increment the value of number three.

OK, so we can do that for an indigenous floats and so on.

But the question is what will happen?

Let's comment it out simpler.

But the question is what will happen if we will use it on structs?

OK?

Will you use some operations like we've specified previously, like nonplused plus, if we use it on

point, which is a variable of a point type so we can write down point plus plus point b point one,

which is a variable of a point structure.

We can write down point one plus plus, but now at this point, it should be crystal clear to you that

this thing is not supposed to work.

And the reason is very simple, because we write down plus plus, but what do we mean?

Do we actually want to take each of these fields in incremented by one?

Or maybe we want to take just the field into incremented by one?

And what will happen if we have a structure called employee?

And the first field is basically the name of the employee, then what will it mean?

Like Employee Plus Plus?

What will it mean, what field should win criminally, how we should increment basically a field that

is war, basically that is considered to be of a type like a string?

OK, so that's very important to explicitly specify what we want to do.

We cannot write down point B. one point one equals two point two plus three because what is the result

of these evaluation of these terminology?

OK.

So for that, there is also some option that you should at least know for this point, that's just the

basic option that we can use, and it's called to create fonctions kind of associated with these operations.

I know it's not the most elegant way, but it works for now.

It works just fine for you.

So, for example, you want to make an addition between two points.

You want to see point.

Well, let's say point three equals two point one plus point two.

So the way you can do it is simply by using the addition function that you created, and this addition

function will receive point B one and point B to both of them.

You want to you add together to create the point result and then you simply go over field by field or

basically by the fields that you are interested in.

Maybe other fields simply copy them.

OK.

If the are not part of this addition, I'm just using basic addition.

And finally, once you create these point result, you return it.

OK, so that's one way to solve it.

Another option, basically another function will be to use the increment associated.

This was associated with the operation of, let's say, additions, right?

Instead of additions, we can use the addition function instead of these operator, or we can use addition

function between two points to get the added result.

Again, we can also use it for kind of simulating the increment operator.

So we will send the actual address of a certain point and we will be able to access these fields and

to add them by one, to increment them by one, both X and Y.

And if these structure have additional fields, then we would have to decide what fields should be implemented

and what not.

That's why this thing does not work.

But if we will call these functions from here, like increment here, we can use it increment increment

and send what send the address of point B one.

Then this.

Should do the work.

We will get these peace a point to point you to will point to these point one, and then we will simply

increment the values by one of these actual point one.

So after this line, what we will have is basically point one with the values of two and three.

OK.

And if we wanted to create some new value point three, OK, let's say something like that point.

Point three.

And let's say it should be equal to point one loss.

Point to OK, instead of writing it this way, could his addition of points and then specify point one

and point to.

And that should be.

Good.

OK.

So I hope that's clear.

Let's also just copy it and save it so that we will have these codes right here.

Come on, come on.

Come on.

That's what we had and.

That's what we propose.

Awesome.

So, yeah.

So this is it, guys.

Thank you so much for watching.

Let's move on with the material now that you were filling.

Hopefully more confident and more believing in yourself and your skills is program here.

Good luck.

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