All language subtitles for 20. Reset All Elements of An Array to 0

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 now we are going to write a function that will reset all the elements, all the elements of an array

to zero, reset all the elements of an array to zero warm, maybe to set it all to set all the elements

to be equal to some other value.

So if that's the case, we can see that a function simply does not return anything.

So it's probably going to be of a void type.

So void and let's call it reset aliments or reset.

Yeah, reset elements to zero, for our example.

And this function is very similar to the previous one.

We just get a pointer.

OK, that will hold the address of the first element here.

We have our array, the first element.

So it's going to be named Star BTR and also the size.

It's very similar to the previous exercise we are going to create now a temporary variable called AI

that will help us for iterating over these these arrays.

So equals to zero as long as I listened in size.

And we know for sure that we are passing over all of our array.

And what we are going to do is very simple.

We are going to specify BTR and Index I BTR, specify the address, the address of first element here,

and it's pretty much like working with ARAA right now.

So BTR and, you know, the first address and axis of the element that inside of these square brackets

specifying the index.

So you really access the previous, the real one and the real array and you just modify its values.

So meteoritic bekesi equal to zero and that's what you do for all of your array elements.

And once these function is done, you simply you are not expected to return anything.

Right, because this function is of a void type.

So you simply call it reset elements to zero and there you go.

You should expect that your array will that all the elements will be equal to zero.

So just to make sure you can write here, reset, reset elements to zero, you give it the array and

you also give it a size of three.

There you go.

All the elements of these lines should be equal to zero.

But one way to make sure of it is to write another function that simply gets an array and prints it.

OK, so this was our first function and we are also going to write in this exercise additional function

that is also going to be of every type and it's going to receive, let's call it print error.

It's going to receive it's going to receive a pointer just like previously and this size.

And all he's going to do is to print all the information for this array.

So I'm just I just can't copy this here.

And I fawry equals to zero as long as it's than size C++.

And what we have to do now is simply instead of using it like this, we're going to just print out,

I'm going to remove that print F and print the value, let's say percentage here, write each percentage

and PVR IT index.

I'm not using a backslash and here because I want all of them to be printed in just one line.

So let's just go like this.

And there you go.

You have the function that prints every array that you are going to send it.

And now what we are going to do is to test it out.

OK, so here we have INTERFERER, so let's call the function printer before it was modified, OK, before

I'm just used here or some little message that we'll print before resetting, before we said OK, so

before we said the array is going to be specified here and print are always going to print all the elements.

And now we are also going to add here pretty much the same.

So print, print after preset and print are OK.

So basically you've got the idea we are going to print.

Before that we said all the array and after that we said so let's just build and run it.

Click here on this button.

So there you go.

Just one mistake that I forgot to add, a backslash, zero backslash.

And so before we said one, three, ten and after that we said zero zero zero, you can see that all

are nullified.

So just in the printer you are at a baseline.

So once you're done printing an array, you will go to the next line.

So let's see how it looks right now.

So before the reset, after that, we said and basically it works like a charm.

So thank you guys for.

Watching this was a good video we showed here to functions, research elements to zero and print error.

So keep on practicing and 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.