Thread: Question on increment operator

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    75

    Question Question on increment operator

    I want to know if the output of the following printf statement is undefined:

    Code:
    i=5
    printf("%d %d %d", i++, i++, i++);
    Output:
    Code:
    7 6 5

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Buy a copy of the standard. Or, just read 3.2.


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. assignment operator question
    By l2u in forum C++ Programming
    Replies: 5
    Last Post: 12-17-2007, 09:48 AM
  2. crazy = and [] operator overloading question
    By jarro_2783 in forum C++ Programming
    Replies: 7
    Last Post: 09-15-2006, 08:56 PM
  3. increment and decrement operator
    By jaipandya in forum C Programming
    Replies: 5
    Last Post: 10-20-2004, 06:54 AM
  4. quick c++ operator question
    By pkananen in forum C++ Programming
    Replies: 3
    Last Post: 12-11-2001, 06:46 PM
  5. increment operator Question from a beginner
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-05-2001, 08:23 AM