What's the difference in practice between inline and #define?
As the title says; what's the difference in practice between the inline keyword and the #define preprocessor directive? #define is a preprocessor tool and has macro semantics. Consider this, if max(a,b) is a macro defined as #define max(a,b) ((a)>(b)?(a):(b)) : Ex 1: val = max(100, GetBloodSample(BS_LDL)) would spill extra innocent blood, because the function will actually be called twice. This might mean significant performance difference for real applications. Ex 2: val = max(3, schroedingerCat.GetNumPaws()) This demonstrates a serious difference in program logic , because this can