Chapter 7

Functions

Abstract

This chapter uses the previously learned C statements and expressions to explain how to properly make C functions. The main() function and user-defined functions are covered.

Much of this chapter deals with the various methods to pass data into a function, including pass by value, reference parameters, and default parameters. Function return values, the use of functions in expressions, and dealing with passing back complex types are all explained.

This chapter also covers the advanced topic of function overloading. Recursion is briefly introduced as an ineffective concept for use on PIC® microcontrollers.

Programming methodologies such as object-oriented and top-down are introduced.

Examples and exercises are ...

Get Embedded C Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.