This exercise corresponds to the similar exercise on the previous slide. In the Date struct and the Person class of this slide we pass a struct value as a value parameter to the method DayDifference. Assume in this exercise that the formal parameter other in Date.DayDifference is passed by reference (a C# ref parameter). Similarly, the actual parameter dateOfBirth to DayDifference should (of course) be passed by reference (using the keyword ref in front of the actual parameter). What will be the difference caused by this program modification. You should compare with the version on on the slide. Test-drive the program with a suitable client to verify your answer. |