This is a discussion on Inline Function C++ within the C and C++ Programming forums, part of the Software Development category; may i know the advantages of inline functions...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| may i know the advantages of inline functions |
| Sponsored Links |
| |||
| Inline functions are functions where the call is made to inline functions. The actual code then gets placed in the calling program Inline is that you can sometimes speed up your program by inlining the right function. Instead of calling the function every time it is invoked, the compiler will replace the function call with a copy of the function body. If it's a small function which gets called a lot, this can sometimes speed things up.
__________________ The MOSS Master of Solution Service |
| |||
| Inline function are exactly similar to macros in c. By making a function inline we just make a request to the compiler to treat the function as inline. the compiler may reject the request for several reasons for instance if we use loop || control structures such as switch-case it will be treated as normal function. As the name says it is a function defined in "a line" we can extend the length of the program upto 4-6 lines. The only difference between the Macros & inline function is, inline function have more control over the arguments/parameters passed to it.
__________________ SeeSamJagan- Sky is not the "LIMIT", Death is not the END, There is still something beyond.... |
| |||
| Total number of Lines for inline function should be less...not more than 10.... |
| |||
| Hi i think length(no. of lines) of the inline function depends on the compiler. as the length grows, it looses the percent of possibilities for being inline. we cannot say it is exactly less that 10 lines.
__________________ SeeSamJagan- Sky is not the "LIMIT", Death is not the END, There is still something beyond.... |
| |||
| hi Quote:
~~~~ Quote:
__________________ SeeSamJagan- Sky is not the "LIMIT", Death is not the END, There is still something beyond.... |
| |||
| Hi, In the last example i just made a mistake, just change as drawLine() instead of starLine () in the main function..
__________________ SeeSamJagan- Sky is not the "LIMIT", Death is not the END, There is still something beyond.... |
| |||
| Hello friends Thanks for sharing so much of information..Bt please also define the inline function by giving example of program... Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is the use of ob_start() function? | saravanan | PHP Programming | 3 | 03-28-2008 02:57 AM |
| Inline javascript Tips & Tricks | Sabari | HTML, CSS and Javascript Coding Techniques | 9 | 12-18-2007 06:14 AM |
| reload function | simplesabita | Testing Tools | 1 | 08-22-2007 03:45 AM |
| What are inline functions? | prasath | C and C++ Programming | 3 | 07-20-2007 06:28 AM |
| Diff inline function and ordinary function | vigneshgets | C and C++ Programming | 1 | 05-24-2007 11:34 AM |