473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What is the execution sequence for the code (x = i++ + ++i) ?

main()
{
int i=1;
int x;
x=i++ + ++i;
printf("%d",x);
}
Aug 21 '10 #1
4 2132
donbock
2,426 Expert 2GB
Strange how this question has arisen so many times recently. Look here and here and here.
Aug 21 '10 #2
I want to know how compiler compile this code?
In which sequence it is going to execute.
firstly "i++" or "++i".
Its Associativity?
Aug 21 '10 #3
donbock
2,426 Expert 2GB
This is a trick question; nobody can answer it. The explanation is in those links I gave you in my first reply.

I'm curious why you're asking about this.
Aug 21 '10 #4
code green
1,726 Expert 1GB
I suggest it is clever question set by a tutor as an assignment,
to test the students understanding of compiler logic.

So an explanation of why it is impossible to answer is what the tutor is looking for.
Aug 23 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: nader | last post by:
hello what is the code to creating text compose many cells almost like excel program to or how do that and thankyou for all :?: Posted Via Usenet.com Premium Usenet Newsgroup Services...
3
by: sugaray | last post by:
Can somebody explain to me what is sequence point ? With few examples would be even better. Thanx for your help.
13
by: dbuchanan | last post by:
This code resets a form with two cbo's (comboBoxes) and one datagrid. The first cbo (cboSelection) selects a main table and filters the second cbo. The second cbo (cboView) selects the secondary...
1
by: Leonnhy | last post by:
HI, I'm a beginner in using MS Access. What's the code for the bring forward figure in current sales report I create as follows:- Once I click on the sales report, it will show me the date range...
1
by: aboood | last post by:
Hi guys Could any one tell me what does that code do please? in pseudo-code #include <fstream.h> #include <iostream.h> bool differsByOneDigit ( int , int ); void outputResults ( ofstream & ,...
18
by: Frank | last post by:
I'm using Sleep(100) and that works OK. However, it would be better if my app continued to receive and process keyboard messages. How can I pause the execution of code in one routine while...
1
by: phundal | last post by:
can any body tel that after compilation of our program our program is converted into native code(in c an c++ languages) my question is what is native code??????
1
by: locy | last post by:
can someone explain to me "what does this code do" class baseclass { public: virtual void runme() { std::cout<<"are you"<<std::endl; }
1
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
What are the default execution sequence of the following vb in running a vb.net application? I want to know when MySettings are populated with values when I run the application. ...
5
by: =?ISO-8859-1?Q?Marcel_M=FCller?= | last post by:
Hi, I have a question about the execution sequence of the postfix increment operator with respect to a function call. void foo(int type, int*& data); int* sequence;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.