Hello and welcome to the and programming language course in this session, we want to talk about Ari's
concept.
Now, days in go.
Arise and go land is much similar to other programming languages.
In the program, sometimes we need to restore a collection of data at the same time, like a list of
a student marks, such type of collection is a thought in the program.
Using an array and array is a fixed length sequence that is used to assess or homogenous elements in
the memory due to their fixed length array are not much popular, like a slice and go language in an
array.
You are allowed to store zero or more than zero elements in it.
The elements of their array are indexed by using this square brackets index or create or with their
zero base position means the index of the first element is only zero and the index of the last element
is at a glance at a minus one.
Creating and accessing injury, Ingo language arrays are created in two different ways.
First, using Vancouver Declaration and second using shorthand declaration, first using virtual in-goal
language and arrays created using the vernacular of a particular time with name, size and elements.
You can see the syntax in this line.
Important points First encode language arrays are mutable so that you can use array index syntax to
the left hand side of the assignment to set the elements of the array at the given index.
Second.
You can access the elements of the array by using the index value or by using for loop turn in go language,
the right time is one dimensional force the lengths of the arrays fixed and unchangeable.
And if you are allowed to assess or duplicate elements in an array.
Now go to tomorrow get program to illustrate how to create an array using the VAD keyboard and accessing
the elements of the audio using their index value.
First, go to extérieur and create a project folder.
For example, very.
And create a fund like me, just go back, raise me and create function me.
OK.
Everything is OK.
First creating and any of this trying time and using that keyboard to the following that.
Names.
Square clear brackets, three and time radiated a.
You can access or assign the array elements by referring to the index number, then they specify in
this score brackets for the example the names and the square brackets, zero equals gene and the other
names.
This score bracket one equals gene and enhanced my names S-Corp bracket.
Index two equals Alex.
Now we can access the elements of the array by using index value when you walk the index of an element.
It will return the value of that element.
Now do the following for the example display a message, display arrays and then
go to the next line.
FP Elements one column
names the square brackets zero.
It returns the value of index zero of names, value will go to the next line.
FP Alliance two column names this group rocket index, Vong and FP.
L.A. three columns names Esquire Bracket Index to save the project and execute the quote
from his last name, that cool.
Now we can see the output areas, elements, elements one equals gene elements two equals gene and elements
three equals Alex.
In this sample, first, we define an anybody, but we know you then initialize element of array by
index and pin the value of at a by accessing via index of array elements.
Now go to a slide and continue.
Second, they for creating and accessing and a is using shorthand declaration in goal language areas
can also declare using shorthand declaration.
You can see the syntax for it.
Now, go to this school to illustrate how to create an area using shorthand declaration and accessing
the elements of the array using for loop.
First, clear, the last quote.
Save the project, define and added by shorthand declaration for the example, create and add a name
names color equals S-Corp I and set the lens for any food and sets the time the string and curly brackets
for initialize the variable
gene, comma, key, comma, Alex and comma date.
We could define and names at a variable and initialize it.
Go to the next line and accessing the elements of the array using fold first right and message FP
elements added color and go to the next line.
Define L2 for iterate.
The elements of add a fourth I call an equals zero I less than four because the length of array is four
and a high class plus.
In the next line, we create a code that return the value of each element of array by names.
This square bracket indicates I reformat the code, save the project and execute the code.
Now we can see the output elements of Add A Is Jean Keen, Alex and David in this sample?
First, we define and add Avery.
Then we are shorthand declaration and initialize elements of it.
Then accessing the value of array by iterate the elements of it by for loop in order not to prolong
the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.