Chapter 4

Functions and Recursion

A large program is often divided into smaller parts called modules. Each module can be realized in the C language with the help of functions. Functions enable people to create their own specific task. A major advantage that C gives us is the ability to create function libraries and then program using only those library functions needed to accomplish the tasks, the program needs to perform. So far, we have been restricting ourselves to a few functions, namely, the main and some standard I/O functions. In this chapter, we shall demonstrate how functions are designed, how two or more functions are put together, and how they communicate with each other.


C functions are broadly classified into ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.