Exercises in this lecture   previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'  Go to the notes, in which this exercise belongs -- Keyboard shortcut: 'u'   Alphabetic index   Course home      

Exercise 1.4
Functions with struct input and struct output


Change the program from above such that also the new address is passed as a pointer to a structure. I.e, in this version both parameters to move_person should be pointers.

Program another version that returns a moved person from the function (via return). The input person should not be changed. In this version of the program, you may choose to use pure call-by-value parameters (and rely on the value semantics of structs).


There is no solution to this exercise