Tuesday, 2 January 2018

Difference between macros and function


  • Macros

    • its pre-processed
    • program length is increased
    • no type checking
    • macro name is replaced by its value (before compilation)
    • use when small code use multiple line

  • Function

    • its compiled
    • code length remains same
    • type checking is done
    • function is called then control is transferred
    • use when large code use multiple time 

No comments:

Post a Comment