Hello and welcome to the golden programming language course in the previous session, we talked about
methods bitcoin to a receiver.
And in this session, we want to talk about the other destructive concept.
Metal can accept bonus points for earned value.
As we know that Ingo in function has a value argument, then it will only accept the values of the parameter.
And if you tried to pass a pointer to a value function, then it will not accept or vice versa.
But a gold medal can accept both value and point to whether it is defined with -- to or value receiver.
Now let's go to a school program to illustrate how the method can access -- and value.
First, create also a structure.
Time, oh, sir.
This rocket is set to variable name and branch name.
Strong words, branch.
A strange.
Oh, define the method with appoint a receiver of over time, fine, define a receiver a asterisk.
Well, sir, sit a name like show volume and set parameter, a bench and a string.
Go to the metal and asterisk, a dance wrench equals a wrench.
In this case, we assign new branching old parents by them and create another method with the value
receiver of all serve time for the example font.
Value receiver, a wholesaler.
Sydney show two.
In this method, we set name filled of Ozer, a song by Julia enU, a dance name.
You called Julia.
And displayed Ayda Field name.
If he.
Well, sir.
Name.
He got to.
And through the message well before changing his plea.
Before.
And.
Reformat the code and save the project.
Now, go to main function and create an initialize and stands of old stories rocket.
Go to main function.
Define a very inner life result.
Calling equals also.
Name, King and branch
see is the disparate branch name before it moves the metals.
AFP.
Branch name before
calling it resolved that branch.
Go to the next line now, calling the show one metal or points or metal street value.
Resolve.
There are.
So bound to set a new branch e c e go to the next line and display branch named after the show one method
FP.
Branch name after
changing reasons that branch through to the next line and now calling this show tone, method or volume,
it'll be the pointer of ampersand resolved.
Dot Show.
Two and display the almost her name after calling Show Tomb.
It'll just be.
Oh, sir's name after.
Colin and resolved that may be 4Matic who saved the project and execute the program.
Now we can see the output.
Branch name is C s e before calling, so one middle and branch name is e c e.
After calling short one metal and Olson's name is Julia B. Forhim of the short two metal and ulcers
name is came after invoking the soul to metal, and we could see that metal can accept both very and
tones, or whether it's defined with points where value receiver in order not to prolong the time of
decision to be finished, and we will continue the content in the next session.
Goodbye.