Inline Function Learning.
# Include <iostream> # include <string> # include <fstream> using namespace STD; # define f (x) (x + 1) # define floor (X, B) (x)> = (B )? ) // The benefit of parentheses # define band (x)> 5 & (x) <10? (X): 0) inline int plusone (int x) {return ++ X;} // The Inline Function in C ++ replaces the macro class point {int I, j, k; public: Point (): I (0), J (0), K (0) {} Point (INT II, int JJ, int KK ): I (ii), J (jj), K (kk) {} inline void print (const string & MSG = "") const // inline function {If (MSG. size ()! = 0) cout <MSG <Endl; cout <"I =" <I <"," <"J =" <j <", "<" k = "<k <Endl ;}}; class forward {int I; public: Forward (): I (0) {} int kk () const {return g () + 1 ;}// ------------- forward reference int g () const {return I ;}}; class access {int I; public: int read () const {return I;} // inline function improves efficiency int set (int ii) {I = II ;}}; int main () {point P, Q, 3); p. print ("value of P"); q. print ("value of Q"); Forward frwd; frwd. kk (); Return 0 ;}