The #define Statement
One of the primary uses of the #define statement is to assign symbolic names to program constants. The preprocessor statement
#define TRUE 1
defines the name TRUE and makes it equivalent to the value 1. The name TRUE can subsequently be used anywhere in the program where the constant 1 could be used. Whenever this name appears, the preprocessor automatically substitutes its defined value of 1 into the program. For example, you might have the following Objective-C statement that uses the defined name TRUE:
gameOver = TRUE;
This statement assigns the value of TRUE to gameOver. You don’t need to concern yourself with the actual value you defined for TRUE, but because you do know that you defined it to be 1, the preceding ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access