Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Structures

The Objective-C language provides another tool for grouping elements together besides arrays. Structures can also be used, and they form the basis for the discussions in this section.

Suppose you wanted to store a date—say, 7/18/03—inside a program, perhaps to be used for the heading of some program output or even for computational purposes. A natural method for storing the date would be to simply assign the month to an integer variable called month, the day to an integer variable day, and the year to an integer variable year. So the statements


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint