Exforsys
+ Reply to Thread
Results 1 to 3 of 3

About Macros

This is a discussion on About Macros within the C and C++ forums, part of the Programming Talk category; Are there any disadvantages because of using many macros in a C programming language? I want to know about that. ...

  1. #1
    sammy is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    144

    About Macros

    Are there any disadvantages because of using many macros in a C programming language? I want to know about that. Someone kindly provide a detailed explanation on this.


  2. #2
    rachelle is offline Member Array
    Join Date
    Apr 2006
    Answers
    97
    Macros must be handled by programmers with great care only when needed. Some of the disadvantages are:
    The ways in which macros are handled by preprocessors vary greatly from compiler to compiler.
    The impossibility of including C directives within a macro.


  3. #3
    Sandhya.Kishannag is offline Member Array
    Join Date
    Feb 2012
    Answers
    66
    The main disadvantage of macros is that it increases the size of the program because the pre processor will replace all the macro names by its actual definition before compiling the program.Hence it saves the time required to call a function when a function call is made.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...