Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Sequence points

Reply
Thread Tools

Sequence points

 
 
Sheky
Guest
Posts: n/a
 
      09-18-2011
Hi,
consider this program:

#include<iostream>
using namespace std;
int main()
{
int i=0;
i= ++i + 1 + (i++*4);
cout<< i;
return 0;
}
how value of i will be calculated? what is the relation of
sequence point with this problem?
 
Reply With Quote
 
 
 
 
Sheky
Guest
Posts: n/a
 
      09-18-2011
so is it also undefined?
i=i++ +1;// it gives answer : i+2

explain more on sequence point. and same rule is with C also?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about sequence points spibou@gmail.com C Programming 3 08-12-2006 10:01 PM
Knowing your sequence points akarl C Programming 7 08-12-2005 02:21 AM
Does C++ have sequence points ? Timothy Madden C++ 4 09-21-2004 08:21 AM
Sequence points Dave Theese C++ 2 09-03-2003 08:16 AM
Sequence points j C Programming 4 07-24-2003 11:14 AM



Advertisments