#define MYMAC(p h) if(h 1) cout << "pinter and H valid" << endl;
The second version replaces the macro. So a call to MYMAC(ptr) where ptr is some pointer you get warnings that not enough arguments for the macro which is because the second version has replaced the MYMAC definition.
They are appropriate when their impact on code size in not adverse i.e. their size is small and they are not called from too many different places.
They are suitable when they are in the deepest of the loop hierarchies. It helps remove too many fuction calls and improve performance. It may also help in better code optimizations.
The other advantages have been covered above like compiler support for type checking and facility of providing overloads.
Inline function very much confused to use it or not. Well I want to just tell you that it has large number of disadvantages than advantages
Inline function works faster than normal function. They are included in the code where the function call appears. The main disadvantage of inline function is the memory collapse as the function are included every time where the function call appears.