sequence points

Discussion in 'C Programming' started by Jrdman, Aug 17, 2008.

  1. Jrdman

    Jrdman Guest

    hi

    According to the standard these are how we define sequence points:


    *the call to a function ,after the arguments have been evaluated

    *the end of the first operand of the following operators :

    {logical AND :&&

    Logical OR :||

    Conditional ?

    Comma ,


    }
    *the end of a full declarator


    *the end of a full expression:an initializer , the expresion in an
    expression statement

    the controlling expression of a selection statement (if or switch)

    the controlling expresion of while or do statement,eatch of the
    expressions of a for statement

    the expression in a return statement


    *Immediatly before a library function returns


    *After the actions associated with eatch formatted input/output
    function conversion specifier


    *Immediatly before and immediatly after eatch call to a comparison
    function,and between any call to a comparison function and any
    movement of the objects passed as arguments to that call

    can someone explain eatch one deeply?
     
    Jrdman, Aug 17, 2008
    #1
    1. Advertising

  2. Jrdman <> writes:

    > According to the standard these are how we define sequence points:

    <snip full list of places where sequence point occur in C programs>
    > can someone explain eatch one deeply?


    That's asking for too much work. None of them seem particularly
    confusing to me, so it would help if you said which ones are confusing
    you. If it really is all of them, then you need to go back and review
    some basic C terminology.

    --
    Ben.
     
    Ben Bacarisse, Aug 17, 2008
    #2
    1. Advertising

  3. Jrdman

    Jrdman Guest

    On Aug 17, 2:52 pm, Ben Bacarisse <> wrote:
    > Jrdman <> writes:
    > > According to the standard these are how we define  sequence points:

    >
    > <snip full list of places where sequence point occur in C programs>
    >
    > > can someone explain eatch one deeply?

    >
    > That's asking for too much work.  None of them seem particularly
    > confusing to me, so it would help if you said which ones are confusing
    > you.  If it really is all of them, then you need to go back and review
    > some basic C terminology.
    >
    > --
    > Ben.


    Just explain what you can explain (if you want a few ones of them)
     
    Jrdman, Aug 17, 2008
    #3
  4. Jrdman

    osmium Guest

    "Jrdman" wrote:

    > According to the standard these are how we define sequence points:


    > *the end of the first operand of the following operators :
    >
    > {logical AND :&&
    >
    > Logical OR :||


    The article in the link should be helpful in this particular case, this is a
    situation where other languages may differ.

    http://en.wikipedia.org/wiki/Short-circuit_evaluation

    I'll leave the other to people with more time on their hands.
     
    osmium, Aug 17, 2008
    #4
  5. On Sun, 17 Aug 2008 07:47:06 -0700, Jrdman <> wrote:

    > hi
    >
    > According to the standard these are how we define sequence points:
    >

    <snip>
    >
    > can someone explain eatch one deeply?


    I know you were directed to reading the standard in the other thread, but
    I now get the impression that you are probably better off reading the C
    FAQ. It explains what sequence points are, how it could affect the code
    you write, and gives you several examples.

    http://c-faq.com/expr/seqpoints.html


    - Anand
     
    Anand Hariharan, Aug 17, 2008
    #5
  6. Jrdman

    Ian Collins Guest

    Jrdman wrote:
    > On Aug 17, 2:52 pm, Ben Bacarisse <> wrote:
    >> Jrdman <> writes:
    >>> According to the standard these are how we define sequence points:

    >> <snip full list of places where sequence point occur in C programs>
    >>
    >>> can someone explain eatch one deeply?

    >> That's asking for too much work. None of them seem particularly
    >> confusing to me, so it would help if you said which ones are confusing
    >> you. If it really is all of them, then you need to go back and review
    >> some basic C terminology.
    >>

    >
    > Just explain what you can explain (if you want a few ones of them)
    >

    Go back to the referenced sections, the explanations are clear.

    --
    Ian Collins.
     
    Ian Collins, Aug 17, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Theese

    Sequence points

    Dave Theese, Sep 3, 2003, in forum: C++
    Replies:
    2
    Views:
    344
    Karl Heinz Buchegger
    Sep 3, 2003
  2. Timothy Madden

    Does C++ have sequence points ?

    Timothy Madden, Sep 20, 2004, in forum: C++
    Replies:
    4
    Views:
    408
    Peter van Merkerk
    Sep 21, 2004
  3. j

    Sequence points

    j, Jul 23, 2003, in forum: C Programming
    Replies:
    4
    Views:
    383
    Tak-Shing Chan
    Jul 24, 2003
  4. akarl

    Knowing your sequence points

    akarl, Aug 11, 2005, in forum: C Programming
    Replies:
    7
    Views:
    394
    Jack Klein
    Aug 12, 2005
  5. Question about sequence points

    , Aug 4, 2006, in forum: C Programming
    Replies:
    3
    Views:
    281
    Clark S. Cox III
    Aug 12, 2006
Loading...

Share This Page