Signs we are covering the use of variables.
It's worth explaining the syntax used to define pointers and the race because there are some potential
pitfalls.
So working with the memory arrays and pointers covers in the in next lectures in more detail.
So we will just introduce the syntax so that you are familiar with it.
So in C++ you will access memory use a typed point.
So the type indicates the type of the data that's held in the memory that is pointed to.
So if the pointer is an four byte integer pointer, it will point to four bytes that can be used as
an integer.
If the integer pointer is incremented, then it will point to the next four bytes, which can be used
as an integer.
So in C++, pointers are declared using the asterisk here.
Asterisk.
So using this asterisk symbol and you access a memory others with this and opera.
So let's create a pointer.
P here integer E, 52 and P equals and operator and the symbol here.
And so now I want to explain uncomment these lines.
So you can when you download these codes, you got the understanding of what these lines means.
So the first line declares a variable P, which will be used will be used to hold the memory address
of an integer.
So the next one here.
The second line declares an integer, declare squares and an integer and signs value.
As you remember, this is just an usual, usual thing that how we declare the integer values here.
Nothing strange here but new here for for us.
Here and here.
As you can see, we used the end operator.
So this and the third line.
The signs of value assigns a value.
Assigns a value.
So this assigns a value to the pointer P here.
To be the address.
Of the integer.
Valuable.
So it's important to stress that the value of P is not 52.
If the memory others where the value of 52 is stored.
So not how the declaration has the asterisk here on the variable name.
This is the common convention that the reason is that if you declare several variables on in one statement,
the asterisk here applies only to the immediate variables.
So for example, let's create an integer integer P one, p2p3 here.
So as you can see here, this is the example of this is a common convention.
The reason is that if you declare several variables in one statements, this asterisk applies only to
the media immediate variable.
And let's create another example of the declaring pointer types here.
So this looks like you're declaring here as you as you can see this make here integer, this will look
like you are declaring two integer pointers.
However, this line does not do this here.
Integer P one.
An integer feature.
Actually, we did app1 integer SW one.
Integer as to.
Here.
So.
As you can see here.
This line does not do this.
So we have three pointers here.
Point two types here.
And this line does not do as does this, because the second variable is an integer called P called S
two, and it declares just one pointer called called S one integer pointer here.
And if you wish to declare the two integers in one statement, then you should do as follows.
Here p one and or.
One and.
To to.
So this is the correct one if you want if you want to declare two pointers to 2.8 types here.