macros?

1 reply [Last post]
dhanunjaya
Offline
Last seen: 9 years 32 weeks ago
Joined: 2009-04-26
bOt Points: 153

What are macros? what are its advantages and disadvantages?

codeguru
Offline
Last seen: 10 years 21 weeks ago
Joined: 2009-04-08
bOt Points: 114
going by the language of your

going by the language of your question seems like i am actually attempting a examination paper

 

The main advantage of using the macro is the speed of the execution of the program (if macro is not used in the program many times or if the program is small). The main disadvantage of the macro is it increase the size of the program because the pre-processor will replace all the macro name in the program by it actual definition before the compilation  of the program. Another disadvantage is tht since there is very little error checking in macros , a macro if not written  properly can lead to a  program  with fair amount of bigs.