Chapter 6. The C Language

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to write programs in the C programming language

  • How to write C programs using the structured programming style used in the Mac OS X C frameworks, including Core Foundation, Quartz 2D, Core Audio, and OpenGL

C is probably the most successful programming language that there has ever been. Whether you realize it or not, most of the software you use daily has something to thank C for. Operating systems, such as Mac OS X, are invariably written in C, and most applications make use of one or more frameworks that are entirely written in C. Popular languages, such as Java, also take much of their syntax from C. Let's face it, apart from the fact that it is still very much in use today, C is the Latin of computer languages.

C also forms the basis of Objective-C, which is a more modern variant used for most new application development on Mac OS X. Objective-C is the core language for the Cocoa frameworks, which you learn about in Chapter 8.

Half the battle of learning to program new applications on Mac OS X is learning to program in Objective-C, which you learn about in Chapter 7. And more than half that battle is learning C. Objective-C is a superset of C, meaning it has everything that C has and a bit more. If you already know C, you are well on your way to mastering Objective-C and Cocoa development (which you learn about in Chapter 8).

In this chapter, you learn the basics of C, which will serve you well whether or not you continue ...

Get Beginning, Mac OS® X Snow Leopard™ Programming now with O’Reilly online learning.

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