Action is regarding arrests in C++, so we have studied about variables, data types and also we have
looked into control statements and patient statements support like when we are declaring a simple single
immediately, it will really having a provision to store one value in that meeting for.
So if I'm declaring.
Let me get the panel so for you.
OK, so if I'm declaring E!
Equal to 10, then my baby will be having a provision to hold only one value, they're distant if I'm
giving equal opportunity at some point of time.
This existing 10 will be replaced with 20 and it will store that value.
So if I want to store 10 different values, I will need 10 different variables.
State if I'm naming my baby was ABC to like, like like that.
If I'm having 10 different values, I will need to use 10 different variables.
So this is not a good practice, so in order to do store similar kind of values consecutively within
same name, I will be having our day best picture on a provision in the C++ part of this.
So why does it not a collection of elements of similar database in which the elements can be unique
and located in separate memory locations?
So you can see one array over here.
This is an example for anybody.
Having the name of that is violence, but the same are again stored.
Minivan use it savvy thousand to three point four seven fifty.
All the values that started in this city, but in different locations, memory locations, different
parts in the computer memory.
But what is the case about is it will always use or stored away neighbors in consecutive memory locations
in nearby many locations.
So how we can create in order, we can create an array of new data, right, by specifying the data
type, then really, but tonight, then size of that.
So here is an example int array of 20.
It will create array card array, bit trendy card and security memory locations in memory with the Endesa.
Similarly, I have created one it floor balance of five.
This is next Saturday here.
Like Flot.
This will be a floating point store gallery that any will be balance, and it can be having five memory
locations listed in that computer memory.
So here you can see five memory locations all in and that name is balance.
So the first element of this Iris thousand second element is 2.0, the third item in these three 3.4.
For them in the seven and.
So instead of in this state.
Right.
So.
Even just declaring an error, there would be no value, so here it will be like blind got a no value.
So all the values in this will be nothing but how I can insert this value that is next publicly.
See, here is the way we can insert the values into adding.
So the senior position of this added balance can be accessed by using the statement balance of zero,
then to give that value.
You can use assignment equal to and then put thousand.
So then the thousand will be coming over here.
Similarly, to get the value of the second part of that.
You can use balance of one.
So I was hearing that starts at zero, that that will be one blind.
You have to remember it stocks one zero.
Then it moves forward.
So if I want to get the first element, it should be balance of the second element balance of one.
OK.
Similarly, balance of N minus one.
So I have I saved all the balance, another easily assigning all the values at once.
That's one more way that's shown over here, like flood balance of five equal to zero value lot faster
value, second value, third value for time.
That means by values that all these statements this these doorways are similar.
It will both give you an array like this.
OK.
No, we have it time for our demo session.
We can go to C++ program and see how what I sort of used in C++.
So we had in the program.
Let's see.
So here you can see I have declared one today, which is again, these are bank card numbers.
Then I am asking the user to give final numbers, which is which is actually I'm going to put pen.
This might my adding numbers.
I want to get final most from the user and then I have to store that fine.
I'm listening to my body.
OK.
God numbers.
So why we are losing for.
Because I want to get the numbers right, so I am using it for law and specifying that index of that
value, so I start from zero, which means numbers of I hear and I have numbers of eight between us.
Fastest numbers of zero seen and asking for that value, right?
So it will give that.
So first time, this will be no worse off.
Zero.
So whatever number you set us ending, it will be going to that zero.
The position of the.
Then I'm going to increment the value, so it will be a plus plus or I equals a plus one.
This is the shorthand for it, so it will be one.
Then I'm going to check the condition.
So it's one less than five.
Again, no cell.
So no myself one will be asked and I was told that value in the same number of one.
Similarly, this will repeat five times.
Right?
Zero one two three four.
And on each execution of this follow, I would get the position right.
I will get the numbers on each portion of that.
Now they will similarly for branding it instead of seeing the rosy sealed and giving some space.
Let's see how this program will look like.
I think you will you go understanding of this program.
So let us by executing this program first.
Before that, I need to compile that.
So D-plus plus plus I race.
Dot CPB program is right.
No, it's not slash, you know, to get the most.
And the final exam leaving that final.
So now it's on to see, you know what position, so it will be asking tomorrow.
That is fascinating, but I will be giving it also here.
I will be giving it.
Go ahead.
Next.
No.
56.
Next, no contract next, No.
21 next.
No.
40 and giving Lee final boss so one time the slope Mexico to Mexico, to Mexico down for time fighting
executed like this.
Now I will be pressing and see all the.
But I haven't done that.
Display 12:46, 120 140.
Because I'm printing miry numbers over here, which means that all the numbers are having endured here
are stored in the record numbers of eight and 12 are stored in numbers of one nine.
56 was stored in numbers of two zero numbers of zero.
Number of solid numbers of two numbers of three numbers of four.
Likewise have stored all the numbers.
And here, by using the sealed statement, I have navigated using the hollow for each gentlemen of that
eight and a half printer.
So how will you gain access to each and every individual element?
Using follow is what we have discussed in particular program, although you have understood that.
Do let me know in the session comments if you have any kind of doubts over.