Maha

Maha

  • NA
  • 0
  • 324.3k

NP59 Changes in Color

Nov 20 2007 9:52 AM

Hi Guys

 

NP59   Changes in Color

 

I got this program from the following website.  

 

http://www.c-sharpcorner.com/UploadFile/rmcochran/chsarp_memory401152006094206AM/chsarp_memory4.aspx

 

When Shoe is a struct, program is giving following output:

 

Bill: Dude!, I have a Blue shoe on my right foot, and a Blue on my left foot.
Ted: Dude!, I have a
Red shoe on my right foot, and a Red on my left foot.

 

When Shoe is a class, program is giving following output:

 

Bill : Dude!, I have a Red shoe on my right foot, and a Red on my left foot

Ted : Dude!, I have a Red shoe on my right foot, and a Red on my left foot

 

In above when Shoe is a class, Blue changes to Red this has been explained but I couldn’t understand it. If anyone knows alternative way please explain the reason.

 

Thank you


Answers (5)