First off, I did google this before hand but most of the answers I got were about assigning attributes, but that's the the trouble I'M having. I'M trying to understand the "this" keyword beging used as a parameter/argument.
Here some sample code
There is a class by the name Elephant.
Elephant lloyd = new Elephant() { Name = "Lloyd", EarSize = 40 };
Elephant lucinda = new Elephant() { name = "Lucinda", EarSize = 33 };
public void TellMe(string message, Elephant whoSaidIt)
{
MessageBox.Show(whoSaidIt.Name = "says: " + message);
}
public void SpeakTo(Elephant talkTo, string message)
{
talkTo.TellMe(message, this);
}
lucinda.SpeakTo(lloyd, "Hello");
According to the book I'M reading, Lucinda's talkTo parameter of the SpeakTo method has a reference to Lloyd's TellMe method. I don't see it. When where and how dos talkTo point to Lloyds TellMe?