Hi-Tech Compiler: Macros

Status
Not open for further replies.

shahram642005

Newbie level 6
Joined
Nov 19, 2013
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
73
hi, I wanna know what are Macros? why and how are they used?
 

They are just a chunk of code, sometimes as short as one line which is given an alternative name. When the name is used in the program, the chunk of macro code is substituted for it. Often the macro can accept one or more parameters in it's declaration and when used those parameters are provided in the program are used instead.

Think of them as being like subroutines but each time the macro name is used in the program, the whole macro code is substituted. In a subroutine you would have one code called from several places.

Brian.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…