what is inline function in c++ in hindi language

what is inline function in c++ in hindi language::-  Programming me function ka main objective  memory space ko save krna hota hai. Lekin function create krna tbhi uchit hota hai jab program large ho ya us program ko bar – bar use krna ho, kyuki jitni baar function ko call kiya jata hai. To function ko call kr execute krne pr calling time bhi alag se lagta hai, if function bahut chote hai to call krne me kafi extra time lagta hai, jisse program ke processing speed kafi slow ho jaati hai. It means function banane se program me memory space bachta h but execution time time badh jata hai. Isliye is prakar ke function ko call krna ek prakar ka overload ho jata hai.

Is problem ko solve krne ke liye c me micro function ka use kiya jaata hai. But c++ me is problem ko different  solution kiya gya hai. Jise Inline function kahte hai. Ye function ek special function hai jo small function ko bar – bar call krne ki problem ko solve krta hai, jaise hi inline function ko evoke kiya jata hai tb waha per yeh apne corresponding se expand ho jata hai. what is inline function in c++ in hindi language Complete information.

Syntax:- 

Inline returntype functionname c parameter

{

 body of function

}

what is inline function in c++ in hindi language

what is inline function in c++ in hindi language

Example:-

#include <iostream.h>

#include<conio.h>

Inline float multi (float x float y)

{

Return (x * y);

}

Void main () {

float a = 15.25; float b = 10.05; cout<<”multi:”<<multi(a,b);

getch(); }

 

inline functions limitations in C++

Inline function kuch situation pr work nahi krta hai::

  • For function returning value if a loop a switch or a go to exists.
  • For function not returning value if a return statement exists.
  • If function contain static variable.
  • If function are recursive.

Making a inline member function in C++

Class me member function ko inside or outside dono prakar se define kiya jaa sakta hai, class ke ander function by default inline hote hai. Yadi hme outside function ko bhi inline function banana hai tb iske liye function ke defining me inline keyword ka use krte hai.

to friends aj ke liye bs itna hi, apko meri ye post what is inline function in c++ in hindi language kaisi lagi hme bataye ager koi question ho to aap comment ke jariye puch skte hai.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons