Chapter 5. Functions and Data Structures

In This Chapter

  • Looking at an application

  • Creating data structures

  • Working with defined data types

  • Collecting statements into functions

  • Understanding function prototypes

  • Knowing what happens when you want to extend the functionality of a program

As I mention in Chapter 1, learning to program in Objective-C involves more than the instruction set and data types you learned about in the last chapter. In fact, you've received a considerable amount of the instruction set covered by now. So it's time to get on with the more interesting aspects of the language, the ones you'll need to know to create the kinds of applications you are probably interested in.

One of the most important features of Objective-C is its support for object-oriented programming. While Objective-C is about objects, before I take you there in Chapter 6, I am going to introduce you to two features of C that are important to understand along the way — data structures and functions. Data structures and functions are a fundamental part of the language, and understanding them will make it easier for you to understand what objects are really about.

Thinking about an Application

In Chapter 1, I mention that when I travel, I often zone out on that fact that even though it looks like monopoly money, foreign currency actually does amount to something in dollars. I said it would be helpful if I could use a computer to let me know when I charged something on a credit card in a foreign currency, ...

Get Objective-C® For Dummies® 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.