home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_11 / 655.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-20  |  706KB  |  2550x3300
Labels: book | reckoner
OCR: 11.7 Defining Macros 655 Running the Program squa re SQUARE( SOR SQR2 square( SQUARE SQR( SOR2 square and SQUARE and SQR2 and SQR and This program is very simple. Three macros. SQUARE, SOR and SQR2, The and function, square all have the purpose of squaring their arguments. function ma in displays the results of different calls to the macros and the function Note 1: The simplest way of squaring a value is defined by the macro SQUARE () When the expression SQUARE parm found in the source it will be replaced by pa arm pa rm. As will be seen later in this program, this macro has some problems Note second form macro to square value contains three sets of paren- theses. Although SQR() works better than SQUARE () it is not trouble free Note 3 The macro SQR2 uses the comma operator in its definiti ...