Here is an example of how to use pointers in order to have a function modify a variable outside of its scope.
If you cannot see this codecast, please click here.
Check Your UnderstandingCheck Your Understanding
1.
Challenge: Please write a function that converts a time given in minutes to hours and minutes. For example, 162 minutes should be converted to 2 hours and 42 minutes, whereas 59 minutes should be 0 hours and 59 minutes. The prototype and main function have been written already; all you have to do is write the function.