Now let's get started with manipulating several elements in our array here.
So in order to manipulate it, we need to get an index number.
So array two here in this case, array two, the second index is eight seven.
As you can see here, we will make the index of 2 to 50 here.
And also we will also make the.
We will also see that the third array.
So my array.
Uh, the third.
And here, let's make it.
70?
Yes.
75 or 73.
And now.
What we will doing here is that we are deleting here.
And actually after that, let's actually create our code again, write it like that here, see out the
new array elements.
New array elements.
Elements here.
And it's going to be the.
And line.
And we will do we will write the same code.
Again here.
So we will compare this, uh, this race here.
So we will compare.
Uh, the result and output differences between these codes.
So, uh, after manipulating.
Of course, here, after manipulating our code.
So now we're going to here.
So now we're going to.
Paste this code here again.
So these are this is the same output.
Here.
This is the same output.
And here, actually, before running, let's actually let me explain this.
So this code we see that initializing an array is simple and this is the dome by defining the array
data type.
So the arrays name here, race name.
Follow it.
By a couple of score bracelets here.
And as you can see here in this case, it's this the couple of square braces here.
So let's actually let me write it again.
And as you can see here, uh, initializing array is simple and defining the array type is more simpler
here.
So we need in order to access these arrays, we just need to use the array types here.
Let me actually use the width narrower here and a bit narrower to here, so.
So.
In this code.
Our array name is my array that we created here.
My array.
So we can access each element by using its index here, the three, two and etcetera.
So in the code we print each element by iterating.
By iterating and accessing the element value using the array and E here.
So E is incrementing.
So it starts from zero and the second loop goes one, two, three, four.
And after being e being four, we are checking that the size of array is no size of E is no longer less
than our array size.
Then after that we are breaking the loop.
So you learned about loops in previous lectures, so I will not return to the loops again.
But if you don't remember the loops well you can check the previous lectures here and then come again
here.
So let's continue our array here.
So actually, let's delete this using the rubber.
Here now.
Uh, we also manipulate the value of indexes the two and three by using.
Actually, it's.
Yeah, we are manipulating the value of indexes by using the two and three here, as you can see here.
So we are assigning 2 to 50.
So the second index, second index goes to 50 here and actually see that.
So second index here.
The second thing, what's the second index here?
87.
So 87 the index to new value is going to be.
What?
The 50 here?
50.
The new value is 50.
And also we are assigning index 3 to 7.
Actually, it's not like that.
It's it's like here we are assigning 50 to index two, we are assigning 73 to index three.
So in this case it's going to be the index.
Two is going to be.
Here.
Index two is going to be 50.
So this is the new value index.
Two is going to be 50 and index three is going to be.
73 here and index three is going to be 73.
73.
Here.
So, uh, the if a build and run this application, let's, uh.
So this was our previous compilation and the result.
Let's use the earth.
All of this here.
And here, let's run it again.
Compile it again and run it again here.
And as you can see here.
The first element goes like this.
25.
21.
Yes.
Is 21.
We didn't do anything to 21.
The first zero index we have the.
Actually, yeah, we have this 47 and as you can see, it goes the usual.
The was the same with the 21, 20 and 47, 21, 47 And here we also have 87.
This was the previous ones here.
So these are all the same.
This is all the same.
And as you can see here, after that, 87 here is changing.
We are manipulating, uh, the index, uh, the value of our array.
And as you can see, it is seven goes the.
250.
And as you can see here, the new value is 50.
So we don't need that.
And the 6969 here changed its value to 73.
And as you can see here, it's 50 and 73.
And about the 35 here, it's the same again.
So there's an interesting fact about arrays here.
So we can access the arrays element using a pointer.
So as you may know, a pointer is a variable that holds the address instead of the value.
So.
And since we have, uh, learned earlier that each element in array has its own address, as you can
see here.
Uh, we can access each element, each arrays element using its address.
So we can also use the pointer to, uh, as an array.
So we'll, you will learn this in next lecture.
So I'm waiting you in.
Next lecture.