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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 12. The Preprocessor > Conditional Compilation

Conditional Compilation

The Objective-C preprocessor offers a feature known as conditional compilation. Conditional compilation is often used to create one program that can be compiled to run on different computer systems. It is also often used to switch on or off various statements in the program, such as debugging statements that print the values of variables or trace the flow of program execution.

The #ifdef, #endif, #else, and #ifndef Statements

Unfortunately, a program sometimes must rely on system-dependent parameters that need to be specified differently on different processors (for example, Power PC versus Intel) or on a particular version of the operating system (for example, Tiger versus Leopard).


  

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