What are Inline functions?
The Inline keyword helps in speeding up programs by making very small functions execute more efficiently. A compiler compiles a new copy of the function each time it’s called. However when you declare a function as inline, when the compiler expands a function call, the function's code gets inserted into the caller's code stream.Essentially compiler will cut and paste the inline function wherever it is called in your program at compile time. Inline functions save the step of retrieving the function, at the cost of a larger compiled program. The MAX function is a typical (and good) example of a good time to use inline:
inline int MAX(int x, int y)
{
return (x > y) ? x : y;
}
C++ FAQ Home
Sponsored links
Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Software Localization Tool Sisulizer
Localize DotNet, C++ Builder, Delphi, C/C++, Visual Basic & Java apps & html help. Try Sisulizer now
Localize DotNet, C++ Builder, Delphi, C/C++, Visual Basic & Java apps & html help. Try Sisulizer now
CSTSOFT Instrumentation .NET & ActiveX Components
A collection of 13 instrumentation .NET/ActiveX/VCL components including Gauge,Knob,LED,Trend etc.
A collection of 13 instrumentation .NET/ActiveX/VCL components including Gauge,Knob,LED,Trend etc.
Web based bug tracking - AdminiTrack.com
AdminiTrack offers an effective web-based bug tracking system designed for professional software development teams.
AdminiTrack offers an effective web-based bug tracking system designed for professional software development teams.
