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

  • Home
  • SEARCH
  • 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 559771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:16:23+00:00 2026-05-13T12:16:23+00:00

I am trying to learn C. Reading through some code, I came across a

  • 0

I am trying to learn C. Reading through some code, I came across a line like this:

__inline__ void () ...

What does the __inline__ mean?. How does putting that word in front of a function make it different?

  • 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-13T12:16:23+00:00Added an answer on May 13, 2026 at 12:16 pm

    __inline__ is a non-standard extension. Typically, it tells the compiler: “inline this function”, but being a non-standard extension we can’t say with certainty unless we know which compiler this is on.

    To inline is to remove the function call and place it’s contents directly where the call would be made. This often removes the overhead of calling a function. It is not always optimal, because of code bloat (code getting too big and not fitting into cache), so most compilers will ignore all inline directives and do what they feel is best. This is a good thing. We humans are very poor at that kind of stuff, and it’s usually considered bad practice to tell the compiler how to do its job.

    Inlining is an important optimization, especially with the presence of helper functions. Imagine a function that returned the smaller of two ints:

    int min(int x, int y)
    {
        return (x < y) ? x : y;
    }
    

    If I used this function in my code, it would be an enormous waste of time to actually make a function call, here. If I had:

    int a = /* some calculation */;
    int b = /* some other calculation */;
    
    int minCalc = min(a, b);
    

    And the compiler inlined that function, the code would become:

    int a = /* some calculation */;
    int b = /* some other calculation */;
    
    int minCalc = (a < b) ? a : b;
    

    Which removes the overhead of calling a function. From here, even more optimizations can be made as the compiler gets to work directly with the code that would have normally been hidden behind a function call. As you can see, if I have a big function and I force the compiler to inline it everywhere, the code size could grow very large very fast, and would actually hinder execution speed.

    There is a standard inline keyword which was used to indicate to the compiler a function should be inlined, but nowadays most compilers don’t even acknowledge it as a hint to inline the function.

    There is an important side-effect of inline, though, and this can be useful. If a function is marked as inline, multiple definitions of the same function across multiple translation units is not an error. Instead, a single function definition is selected and the others are thrown out, and assumed to be the same (it’s up to you to make sure this is actually okay!). This allows you to define a function within a header file without risking ODR violation errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 338k
  • Answers 338k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your query should work fine. The only thing you should… May 14, 2026 at 4:18 am
  • Editorial Team
    Editorial Team added an answer I suppose you can use placement new. int arr[4]; //uninitialized… May 14, 2026 at 4:18 am
  • Editorial Team
    Editorial Team added an answer Yes, but not in pure XAML and not using ElementName.… May 14, 2026 at 4:18 am

Related Questions

When Joel Spolsky and Jeff Atwood began the disagreement in their podcast over whether
I'm working to learn Scala--coming from a C++ background. I am trying to write
I am learning C++. I am trying to learn this dynamic memory allocation. In
I am just testing and trying to learn how assembler works with C. So
I'm trying to learn how to use managed/unmanaged code interop, but I've hit a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.