Sunday, January 31, 2025

Difference between macro and function


Difference between macro and function

 No  Macro Function
1Macro is Preprocessed Function is Compiled
2No Type Checking Type Checking is Done
3Code Length IncreasesCode Length remains Same
4Use of macro can lead
to side effect
No side Effect
5Speed of Execution is
Faster
Speed of Execution is Slower
6Before Compilation macro name is replaced by macro valueDuring function call , Transfer of Control takes place
7Useful where small code appears many time Useful where large code appears many time
8Generally Macros do not extend beyond one line Function can be of any number of lines
9Macro does not Check Compile ErrorsFunction Checks Compile Errors

Tags / Keywords : | ,

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates