Definition of inline | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Definition of inline

hi my friends what is the inline method or function and its role ;

11th Apr 2017, 9:39 AM
‏‪‏‪عبدالله بوستة‬‏
‏‪‏‪عبدالله بوستة‬‏ - avatar
3 Answers
+ 6
1)What is inline function ? The inline functions are a C++ enhancement feature to increase the execution time of a program. Functions can be instructed to compiler to make them inline so that compiler can replace those function definition wherever those are being called. Compiler replaces the definition of inline functions at compile time instead of referring function definition at runtime.  NOTE- This is just a suggestion to compiler to make the function inline, if function is big (in term of executable instruction etc) then, compiler can ignore the “inline” request and treat the function as normal function. 2)How to make function inline ? To make any function as inline, start its definitions with the keyword “inline”. 3)Example : Class A { Public: inline int add(int a, int b) { return (a + b); }; } Class A { Public: int add(int a, int b); }; inline int A::add(int a, int b) { return (a + b); }
11th Apr 2017, 10:04 AM
Hassan Amr
Hassan Amr - avatar
+ 4
@عبد الله بوستة You are wlcome ☺
11th Apr 2017, 1:23 PM
Hassan Amr
Hassan Amr - avatar
0
thinks🤗🤗👍🏿
11th Apr 2017, 12:46 PM
‏‪‏‪عبدالله بوستة‬‏
‏‪‏‪عبدالله بوستة‬‏ - avatar