1 ICS103 Programming in C Lecture 10: Functions II
2 Outline • Introducing Functions that return multiple results •What is a Pointer variable?
3 Introducing Functions that return multiple results • So far, we know how to pass inputs into a function and how to use the return statement to send back at most one result from a function. • However, there are many situations where we would like a function to return more than one result. Some Example are: Function to convert time in seconds into hours, minutes and seconds Function to find the quotient and remainder of a division Function to return maximum, minimum and average from a set of values • In this lecture, we discuss how a function can return more than one result, which is archieved through output parameters, which are pointer variables . • Thus, to be able to write functions that return multiple results, we first need to learn about pointer variables.
4 What is a Pointer variable?
You've reached the end of your free preview.
Want to read all 13 pages?
- Spring '10
- Pointer, Return statement, Void type