int i=5,j=6;
int k=i++ + i++ + ++i + i++;
int m=j++ + j++ + j++ - j++;
cout<<i;
cout<<m;
cout<<j;
cout<<k;
muthu1802
-4
Newbie Poster
Recommended Answers
Jump to PostWhen you write equations like this, you are dealing with a whole lot of undefined behavior stemming from what are sometimes called "side effects". You should never write such a statement because the results are unpredictable at best.
All 3 Replies
daviddoria
334
Posting Virtuoso
Featured Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
Fbody
682
Posting Maven
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.