Click here to Skip to main content
15,867,453 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
__yash__22-Oct-09 2:05
professional__yash__22-Oct-09 2:05 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
David Crow22-Oct-09 2:48
David Crow22-Oct-09 2:48 
AnswerRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
SandipG 22-Oct-09 1:57
SandipG 22-Oct-09 1:57 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
__yash__22-Oct-09 2:02
professional__yash__22-Oct-09 2:02 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
SandipG 22-Oct-09 2:09
SandipG 22-Oct-09 2:09 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
Covean22-Oct-09 2:29
Covean22-Oct-09 2:29 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
__yash__22-Oct-09 2:40
professional__yash__22-Oct-09 2:40 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
SandipG 22-Oct-09 2:44
SandipG 22-Oct-09 2:44 
Covean wrote:
Your example is wrong!

I dont see anything wrong with the output?
++i,j++,i++,++j,++i,j++
1. j++ = 5 true -> j = 5 but after this statement j=6!




Please Try following sample
int i=5;
printf("%d %d %d %d %d %d",i++,i++,i++,i++,i++,i++);


According to you what should be the output?
11 10 9 8 7 6 5?

With VS 6.0 the output is
5 5 5 5 5 5

i++ is post increment and will be executed after execution of printf.
Please correct me if i am wrong?

Regards,
Sandip.

GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
Covean22-Oct-09 2:48
Covean22-Oct-09 2:48 
GeneralHow do you interpret the results (I have provided my comments) Pin
__yash__22-Oct-09 2:35
professional__yash__22-Oct-09 2:35 
GeneralRe: How do you interpret the results (I have provided my comments) Pin
SandipG 22-Oct-09 2:45
SandipG 22-Oct-09 2:45 
GeneralRe: How do you interpret the results (I have provided my comments) Pin
Covean22-Oct-09 2:45
Covean22-Oct-09 2:45 
AnswerRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
David Crow22-Oct-09 2:55
David Crow22-Oct-09 2:55 
GeneralRe: Wrong evaluation of pre- and post-increment on variables: What is wrong here?!?! Pin
__yash__22-Oct-09 20:52
professional__yash__22-Oct-09 20:52 
QuestionText from the Html Table tag. Pin
NaveenHS22-Oct-09 1:09
NaveenHS22-Oct-09 1:09 
QuestionRe: Text from the Html Table tag. Pin
David Crow22-Oct-09 3:08
David Crow22-Oct-09 3:08 
Questionhow to use lpfnhook to keep view of dialog? Pin
002comp21-Oct-09 23:11
002comp21-Oct-09 23:11 
QuestionRe: how to use lpfnhook to keep view of dialog? Pin
CPallini21-Oct-09 23:40
mveCPallini21-Oct-09 23:40 
AnswerRe: how to use lpfnhook to keep view of dialog? Pin
002comp22-Oct-09 0:04
002comp22-Oct-09 0:04 
GeneralRe: how to use lpfnhook to keep view of dialog? Pin
CPallini22-Oct-09 0:17
mveCPallini22-Oct-09 0:17 
GeneralRe: how to use lpfnhook to keep view of dialog? Pin
002comp22-Oct-09 0:30
002comp22-Oct-09 0:30 
GeneralRe: how to use lpfnhook to keep view of dialog? Pin
CPallini22-Oct-09 0:41
mveCPallini22-Oct-09 0:41 
GeneralRe: how to use lpfnhook to keep view of dialog? Pin
Michael Schubert22-Oct-09 0:54
Michael Schubert22-Oct-09 0:54 
GeneralRe: how to use lpfnhook to keep view of dialog? Pin
Richard MacCutchan22-Oct-09 1:40
mveRichard MacCutchan22-Oct-09 1:40 
GeneralRe: how to use lpfnhook to keep view of dialog? Pin
David Crow22-Oct-09 3:10
David Crow22-Oct-09 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.