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 function
small 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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment