Program to illustrates Inline Functions


    #include <iostream.h>
    #include <conio.h>
    inline int square (int a)                 // inline function definition
       {
           return (a*a);
        }

        void main(void)
       {
             cout << "Square(10)  = " << square(10);
             cout << "\n Square(10+10) = " << square(10+10);
                 getch( );   
          }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|