Explain me inline function with example please fast | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Explain me inline function with example please fast

21st Aug 2017, 3:34 PM
Bhupendra Dangwal
Bhupendra Dangwal - avatar
2 Answers
+ 1
an inline is just a function that usually consists of only one return statement for example int sum (int x, int y){ return x+y } usually you declare this functions with the keyword inline because the compiler will handle it in a different way (usually by just copying the code where It is called). For example in a class you should declare setters and getters inline and defining them directly in the header file
22nd Aug 2017, 4:23 PM
Marco
Marco - avatar
0
thanks could u please give me a program of inline function a simple program
24th Aug 2017, 8:53 AM
Bhupendra Dangwal
Bhupendra Dangwal - avatar