Hello and welcome to the goal and programming language course in the previous session, we talked about
sending a into a function in goal.
And in this session, we want to talk about the other's point first concept.
Comparing pointers in gold and in gold language, you are allowed to compare two pointers with each
other.
Two pointers values are only equal, then they point to the same value in the memory or if they are
needed, you can perform a conversion on pointers with the help of equal two and not equal to operators
provided by the gold language.
Now you can see the syntax go to this good program and illustrate how to use competing pointers in gold
language.
First, create an initialized to actual variable for the example, value one column equals 100.
And the next line value two equals 200.
Now create three pointers and initialize them by the address of allow variables.
For the example, P1 call equals person value one and P2 calling equals ampersand value.
Two and P3 column equals ampersand again.
Value one.
Now, compare two pointers together and put the result as a Boolean value in a valid for the example
he compared to pointers P one and P two and set results in the result more valuable.
Now do the following result long column equals p one equal to p to.
By this quote, we can compare to variable and set result in another value the display.
The result of this conversion FP
result from.
He's.
P. Long, equal
and assets, the result one.
So let's do a few more conversions for the example, conversion between P1 and P3 now write results
to calling equals P1 equal to P3 and display the result if be resolved to these P1 equals.
P three and sit to resolve to leave it to other competition for the example, competition between P2
and P3 resolved three Kollin equals P2 equal to P3 display the result FP resolved three E's P two equal
P three and set the result three rated here.
OK.
We will now compare the addresses of the -- to available together, for the example addresses of two
pointers of Pilon and P. to define resolved for call and he calls and some p for equal to Anderson P
three and display the result for FP Zonked for.
He's P one, equal P three and set the result for here.
Vom and PETA.
And the other condition, for example, competition between P1 and P2 resolved fight calling equals
nine percent P1 equal to Anderson P two and especially the result five if P result five is P1 equaled
P2 asset, the variable result five.
And another conversion for the example between P2 and P3 result six current equals countersign p to
equal to Anderson P3 and display the result.
FP results six is P2 equal P3 and set the result six variable here.
Now reformat the code, save the project and execute the program.
Now we can see outputs in all these competitions.
Only the variable Piven is equal to P3 and in the regional two variable, the answer to is sort for
us.
And the other countries are not equal to each other and show us the false answer in order not to prolong
the time of decision.
You will finish it and we will continue the content in the next session.
Goodbye.