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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:23:41+00:00 2026-05-24T23:23:41+00:00

In the expression a + b , is a guaranteed to be evaluated before

  • 0

In the expression a + b, is a guaranteed to be evaluated before b, or is the order of evaluation unspecified? I think it is the latter, but I struggle to find a definite answer in the standard.

Since I don’t know whether C handles this different from C++, or if evaluation order rules were simplified in C++11, I’m gonna tag the question as all three.

  • 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-24T23:23:44+00:00Added an answer on May 24, 2026 at 11:23 pm

    In C++, for user-defined types a + b is a function call, and the standard says:

    §5.2.2.8 – […] The order of evaluation of function arguments is unspecified. […]

    For normal operators, the standard says:

    §5.4 – Except where noted, the order of evaluation of operands of individual operators and subexpressions of individual expressions, and the order in which side effects take place, is unspecified. […]

    These haven’t been changed for C++11. However, the wording changes in the second one to say that the order is “unsequenced” rather than unspecified, but it is essentially the same.

    I don’t have a copy of the C standard, but I imagine that it is the same there as well.

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

Sidebar

Related Questions

Can the order of regular expression matching be guaranteed in .NET? If I have
In C# is it guaranteed that expressions are evaluated left to right? For example:
My regular expression needs to be able to find the strings: Visual Studio 2008
This expression is not working :- <f:facet name=header> Search Results for #{SearchResultsBean.searchPhrase} </f:facet> But
I write regular expression for alphanumerics, but it is not taking space. I want
Speaking of string literals, the C99 standard says (6.4.5.6): It is unspecified whether these
The comma operator guarantees left-to-right evaluation order. [n3290: 5.18/1] : The comma operator groups
Possible Duplicate: Is short-circuiting boolean operators mandated in C/C++? And evaluation order? AFAIK Short
Possible Duplicate: Safety concerns about short circuit evaluation What does the standard say about
Regualar expression: <img[^>]+src\s*=\s*[']([^']+)['][^>]*> This works fine when 'src' is in lowercase and manages both

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.