Skip to main content
Logo image

Section 19.3 Pointer Example

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 Understanding Check 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.

admin.....open in new window

When your program performs correctly you’ll be given a keyword to enter in Canvas.