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
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.