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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:09:52+00:00 2026-06-10T15:09:52+00:00

Cosider the sequence points in the following expression i = (++i,i++,i); If I am

  • 0

Cosider the sequence points in the following expression

i = (++i,i++,i);

If I am correct the steps of execution will be as follows:

1)

++i, i++

2)

step1,i

3)

i = step2

For evaluation in step 1, the value of i should be modified only once for the construct to be termed as defined(since after evaluation of comma operator there is a sequence point). But I think it is not the case here. Hence it should be undefined.
Please see this answer. Here the above expression is termed as defined. Am I missing something ?

  • 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-06-10T15:09:54+00:00Added an answer on June 10, 2026 at 3:09 pm

    The behavior of the following instruction is well-defined.

    i = (++i, i++, i);
    

    There is indeed a sequence point between the evaluations of the first and the second operands of the comma operator (,). The annex C of the standard, although informative, provides a description of the sequence points.

    C11, Annex C Sequence points

    The following are the sequence points described in 5.1.2.3:

    — Between the evaluations of the function designator and actual
    arguments in a function call and the actual call. (6.5.2.2).

    — Between the evaluations of the first and second operands of the following operators: logical AND && (6.5.13); logical OR || (6.5.14);
    comma , (6.5.17).

    — Between the evaluations of the first operand
    of the conditional ? : operator and whichever of the second and third
    operands is evaluated (6.5.15). — The end of a full declarator:
    declarators (6.7.6);

    — Between the evaluation of a full expression and the next full
    expression to be evaluated. The following are full expressions: an
    initializer that is not part of a compound literal (6.7.9); the
    expression in an expression statement (6.8.3); the controlling
    expression of a selection statement (if or switch) (6.8.4); the
    controlling expression of a while or do statement (6.8.5); each of the
    (optional) expressions of a for statement (6.8.5.3); the (optional)
    expression in a return statement (6.8.6.4).

    — Immediately before a library function returns (7.1.4). — After
    the actions associated with each formatted input/output function
    conversion specifier (7.21.6, 7.29.2).

    — Immediately before and immediately after each call to a comparison
    function, and also between any call to a comparison function and any
    movement of the objects passed as arguments to that call (7.22.5).

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

Sidebar

Related Questions

Consider the following sequence of actual outcomes for a single static branch. T means
Consider the following sequence of events: A view v_Foo is defined A user-defined function
Consider the following code to demonstrate the question: let sequence = Seq.initInfinite (fun _
Consider the following sequence of events public static void main(String[] a) throws IOException {
Consider the following sequence of events: You write a function A() that does a
Consider the following text from the PostgreSQL documentation on binary copying: 11-byte sequence PGCOPY\n\377\r\n\0
Finding the maximum or minimum value in a sequence that increases montonically and then
Consider the following matrix: sequence <- structure(list(C1 = c(2L, 9L, 3L, 9L, 1L, 8L,
Consider having the following header file (c++): myclass.hpp #ifndef MYCLASSHPP_ #define MYCLASSHPP_ namespace A
Consider the following C#: // C# .net switch(x) { case 1: for(int i =

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.