Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6130327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:50:43+00:00 2026-05-23T16:50:43+00:00

I want to know how inline function call is replaced by the inline code.

  • 0

I want to know how inline function call is replaced by the inline code.
i read in some book saying compiler may treat the inline function as normal function.

can any own explain how inline function works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:50:44+00:00Added an answer on May 23, 2026 at 4:50 pm

    From the C++ FAQ:

    When the compiler inline-expands a function call, the function’s code
    gets inserted into the caller’s code stream (conceptually similar to
    what happens with a #define macro). This can, depending on a zillion
    other things, improve performance, because the optimizer can
    procedurally integrate the called code — optimize the called code into
    the caller.

    There are several ways to designate that a function is inline, some of
    which involve the inline keyword, others do not. No matter how you
    designate a function as inline, it is a request that the compiler is
    allowed to ignore: it might inline-expand some, all, or none of the
    calls to an inline function. (Don’t get discouraged if that seems
    hopelessly vague. The flexibility of the above is actually a huge
    advantage: it lets the compiler treat large functions differently from
    small ones, plus it lets the compiler generate code that is easy to
    debug if you select the right compiler options.)

    In the simplest case, the inline function is dropped into its call site as if you had copy-and-pasted it there. Thus for,

    inline int madd( int a, int b, int c ) 
    {
       return a * b + c;
    }
    
    
    void foo( int data[3] )
    {
       int result = madd( data[0], data[1], data[2] );
       printf("%d\n", result); // note to pedants: this is simpler than a cout stream, so there
    }
    

    the compiler could turn it into

    void foo( int data[3] )
    {
       int result = data[0] * data[1] + data[2] ; // madd is replaced inline
       printf("%d\n", result); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know what are the options to do some scripting jobs in
I want to know how to use variables for objects and function names in
I want to know this info to reduce my code size so I will
So far i have this code: function changeGeoLoc($a,$b,$c){ echo <ul style='list-style-type: none; display:inline;'>; while(list(,$geoloc)
Want to know what the stackoverflow community feels about the various free and non-free
want to know why String behaves like value type while using ==. String s1
I want to know what a virtual base class is and what it means.
I want to know what exactly is the sequence of calls that occurs when
I want to know which tool can be used to measure the cyclomatic complexity
I want to know if i can create a custom google maps application,on which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.