How functions work together

A program is a collection of functions. When you run a program, those functions are copied from the hard drive into memory, and the processor finds the function called main and executes it.

Remember that a function is like a recipe card. If you began to execute the Easy Broiled Chicken card, you would discover that the third instruction says Execute the Seasoned Bread Crumbs recipe, which is explained on another card. A programmer would say, The Easy Broiled Chicken function calls the Seasoned Bread Crumbs function.

Figure 5.1  Recipe cards

Recipe cards

Similarly, main() can call other functions. ...

Get Objective-C Programming: The Big Nerd Ranch 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.