Hello and welcome to the golden programming language course in this session.
We want to talk about data types concept.
Data types and go.
The type of a variable determines how much space it occupies in storage and how the bead pattern is
stored is interpreted.
Data types specify the type of data that a valid go variable can hold in go language.
The type is divided into four categories, which are as follows First, basic type numbers string and
Boolean come under this category second aggregate type array and strikes come under this category.
Third, reference type pointers, slices, maps, functions and channels.
Commander This category and force interface type interface is a type in go, which is a collection of
method signatures.
Basic data type here.
We will talk about basic data types in the go language.
The basic data types are folder categorized into the three subcategories, which are numbers Bosnians
and Airstreams.
First, we will talk about numbers.
Numbers are divided into the three subcategories that are integers floating point numbers in complex
numbers.
Integers.
Integers are used to twist or whose numbers go, has several built in integer types of varying size
of the storing Sine and L.S. integers, both signed and unsigned integers are available as the predefined
architecture independent integer types is shown in the diagram below.
The signed integer is represented by INT and the unsigned integer is represented by you.
Int signed integer includes Int Int eight and sixteen in thirty two and and 64.
The size of the generic end type is platform dependent.
It is three bits wide on a 32 bit system and 64 bits wide on the 64 bit system.
Unsigned integers include You ain't you int eight, you aren't sixteen, you ain't thirty two and unions
64.
The size of union type is platform dependent.
It is 32 bits white on a 32 bit system in 64 bits wide and a 64 bit system.
When you're working with integer values, you should always use the data type unless you have a good
reason to use the sized or unsigned integer types.
There are also a couple of alias number times which assign useful names to a specific data times by
Alias for You eight and Rule Alias for entry to
Byte in Go is an alias for you end eight, meaning it is an integer value.
This integer value is of eight bits, and it'll represent one by in between zero dash two hundred and
fifty five.
A single byte, therefore, can represent ASCII characters.
Go length does not have any data type of cache.
Therefore, BI is used to represent the ASCII character in Go.
Language is an alias for N32, meaning it is integer value.
This integer value is meant to represent the Unicode Code Point A Rome is used to represent a Unicode
character, whereas only ASCII characters can be represented solely by an entry to data type.
Now go to this school program to do an example.
First, go to Project Explorer.
Create a folder named like data types and create a file inside.
Eat like me.
Just go.
Define the package name.
So the right package main and defined main function for me.
In this case, we want to define two integer variables first.
Eight bit unsigned integer.
And second, define a 16 bit signed integer.
So first, define via a U.S. eight and initialize it by, for example, 200.
And this abilities variable FP.
Hey, and go to the next line and define A. A value that, for example, via B and 16 and initialize
it by the value minus fifteen thousand four hundred ninety two.
And now go to the next line and display this variable f the.
Be.
OK.
Reformat the court, save the project and execute the program, go to a terminal first, go to Project
Folder, see the data types, killer screening and run the program by the comment go wrong.
Does this mean that Google?
Now we can see the output.
First, we define a U.S. aid variable and initialize it by 200.
And second, we define and end 16 variable and initialize it by the value minus fifteen thousand four
hundred and thirty two.
So we could define two variable by the type signed an unsigned integer in order not to prolong the time
of decision.
We will finish it and we will continue the content in the next session.
Goodbye.