Chapter 7. Creating Your Own Functions

The bulk of programming involves using functions: performing set tasks by calling established procedures. C, like any language, has defined hundreds of functions used to simplify common steps. These range from the standard input/output ones like scanf() and printf() to specialized mathematical functions for trigonometry.

C also provides syntax for you to define your own functions. By doing so, you can encapsulate blocks of code under one name. This allows you to repeatedly execute that code through a simple function call. This move toward more modular programming is a key aspect to developing real-world applications.

In this chapter you'll learn everything you need to know about creating and using your own ...

Get C Programming: Visual Quickstart Guide 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.