Dec 21, 2008

discuss the advantages/disadvantages between 'functions', 'macros' and inline function i.e., the same functionality can be implemented using either ma

discuss the advantages/disadvantages between 'functions', 'macros' and 'inline function' i.e., the same functionality can be implemented using either macros or functions, what are the advantages & dis-advantages

marcos:
faster, insert code directly into your source code, no overhead involved like a call to a functionsmall cannot handle large complex coding structure
functions:
is more suited for large complex coding structure, macros processed by preprocessor and no type checking, function processed by compiler and has type checking
inline function:
inline follows strict parameter type checking macros is always expanded by preprocessor, inline function may or may not expend by the compiler which is depended on inline function’s size. If it is expended, it is like macros else it is like a function

No comments:

Post a Comment