Slide03

Page 255

DAVV

SCS

Inline Functions The macro approach is more efficient since it does not have function call overhead, but, this approach can be dangerous, as we saw earlier Modern C compilers provide inline functions to solve the problem: Put the inline keyword before the function header

inline int max(int a, int b) { return a>b?a:b; }

255

hmehta.scs@dauniv.ac.in


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.