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 7606439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:24:35+00:00 2026-05-31T00:24:35+00:00

In C and C++, is there a fixed order for evaluation of parameter to

  • 0

In C and C++, is there a fixed order for evaluation of parameter to the function? I mean, what do the standards say? Is it left-to-right or right-to-left?
I am getting confusing information from the books.

Is it necessary that function call should be implemented using stack only? What do the C and C++ standards say about this?

  • 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-31T00:24:36+00:00Added an answer on May 31, 2026 at 12:24 am

    C and C++ are two completely different languages; don’t assume the same rules always apply to both. In the case of parameter evaluation order, however:

    C99:

    6.5.2.2 Function calls
    …
    10 The order of evaluation of the function designator, the actual arguments, and
    subexpressions within the actual arguments is unspecified, but there is a sequence point
    before the actual call.

    [Edit]
    C11 (draft):

    6.5.2.2 Function calls
    …
    10 There is a sequence point after the evaluations of the function designator and the actual
    arguments but before the actual call. Every evaluation in the calling function (including
    other function calls) that is not otherwise specifically sequenced before or after the
    execution of the body of the called function is indeterminately sequenced with respect to
    the execution of the called function.94)
    …
    94) In other words, function executions do not ‘‘interleave’’ with each other.

    C++:

    5.2.2 Function call
    …
    8 The order of evaluation of arguments is unspecified. All side effects of argument expression evaluations take effect
    before the function is entered. The order of evaluation of the postfix expression and the argument expression list is
    unspecified.

    Neither standard mandates the use of the hardware stack for passing function parameters; that’s an implementation detail. The C++ standard uses the term “unwinding the stack” to describe calling destructors for automatically created objects on the path from a try block to a throw-expression, but that’s it. Most popular architectures do pass parameters via a hardware stack, but it’s not universal.

    [Edit]

    I am getting confusing information from the books.

    This is not in the least surprising, since easily 90% of books written about C are simply crap.

    While the language standard isn’t a great resource for learning either C or C++, it’s good to have handy for questions like this. The official™ standards documents cost real money, but there are drafts that are freely available online, and should be good enough for most purposes.

    The latest C99 draft (with updates since original publication) is available here. The latest pre-publication C11 draft (which was officially ratified last year) is available here. And a publicly availble draft of the C++ language is available here, although it has an explicit disclaimer that some of the information is incomplete or incorrect.

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

Sidebar

Related Questions

I usually give fixed height in order to avoid views getting overlapped on orientation
Is there a fixed/default sort order in which Dir.entries returns results? I know by
Is there an easy way to do a fixed-effects regression in R when the
Is there a better way to compare a NSNumber with a fixed value, it
While using fixed width select tag , there is one bug in IE. When
Given a DIV with a fixed width, is there a way to have it
I can't make td Date to have fixed height. If there is less in
I need to detect IE6 in order to work around the lack of position:fixed.
I have a list of strings whose values come from a fixed set. I
Let’s say I have a data grid and there’s a method attached to clicking

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.