inline is a 'request'; the compiler takes the decision whether to
fulfill the request or not.
#define is a command to the preprocessor, it has to be expanded before
the actual compilation begins.
Jim Dougherty wrote:
> I am a long time C programmer who is currently trying to teach himself C++
> and I
> just ran into the concept of Inline functions and I have a question. From
> the
> callers point of view (or from any point of view for that matter) how is an
> Inline function any better/worse/different than a macro with arguments? What
> are some reasons to write/use Inline functions as opposed to macros and vice
> versa?
>
> inline double inches_to_feet(double inches) { return(inches/12.0); }
>
> #define INCHES_TO_FEET(inches) ((inches)/12.0))
>
>
>