In this problem we will learn how to use the inline Function in C++. inline Function is mostly used when we working on the classes and compiler jump here and there for collection the codes . The Structure of the inline function is that the compiler make a copy of each inline function and keep them every where ,where these function calls in main class. The technique save the time in very complicated application where time (nano seconds ) matter a lot.
Source Code
#include<iostream> using namespace std; inline int findmax (int ,int ); int main () { int x,y; cout<<" Enter Your Number : \n "; cin>>x; cout<<" Enter Your Number : \n "; cin>>y; cout<<" The Bigger Number is : "<<findmax(x,y); } inline int findmax (int a,int b) { return ( a > b ) ? a : b; }
Good I have didn't know about too much that functions Use Thanks
ReplyDeleteThanks Brother being with us Keep in touch we will uploaded as these function very Soon :)
Delete