Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ListView_SortItems question Pin
Tom Wright15-Sep-05 12:34
Tom Wright15-Sep-05 12:34 
QuestionRe: ListView_SortItems question Pin
ClockDivider15-Sep-05 13:49
ClockDivider15-Sep-05 13:49 
GeneralRe: ListView_SortItems question Pin
Graham Bradshaw15-Sep-05 13:43
Graham Bradshaw15-Sep-05 13:43 
GeneralRe: ListView_SortItems question Pin
David Crow15-Sep-05 16:55
David Crow15-Sep-05 16:55 
QuestionCopy a directory Pin
anderslundsgard15-Sep-05 8:12
anderslundsgard15-Sep-05 8:12 
AnswerRe: Copy a directory Pin
Ravi Bhavnani15-Sep-05 8:57
professionalRavi Bhavnani15-Sep-05 8:57 
AnswerRe: Copy a directory Pin
ThatsAlok15-Sep-05 17:51
ThatsAlok15-Sep-05 17:51 
QuestionAdding Date Time Picker to List Control Pin
ExtraLean15-Sep-05 8:08
ExtraLean15-Sep-05 8:08 
QuestionChange CRichEditCtrl CFE_LINK color Pin
cbusgut15-Sep-05 6:49
cbusgut15-Sep-05 6:49 
Questionc++ and canonical xml Pin
Imre Koszo15-Sep-05 5:59
Imre Koszo15-Sep-05 5:59 
AnswerRe: c++ and canonical xml Pin
David Crow15-Sep-05 6:29
David Crow15-Sep-05 6:29 
GeneralRe: c++ and canonical xml Pin
Imre Koszo15-Sep-05 22:31
Imre Koszo15-Sep-05 22:31 
GeneralRe: c++ and canonical xml Pin
David Crow16-Sep-05 2:01
David Crow16-Sep-05 2:01 
QuestionC++/Java Codes for RHPOP3Connect Pin
codedigger2215-Sep-05 4:55
codedigger2215-Sep-05 4:55 
Questionwhat about x = x++; ? Pin
pesho293215-Sep-05 4:55
pesho293215-Sep-05 4:55 
AnswerRe: what about x = x++; ? Pin
Chris Losinger15-Sep-05 5:35
professionalChris Losinger15-Sep-05 5:35 
GeneralRe: what about x = x++; ? Pin
Anonymous15-Sep-05 6:32
Anonymous15-Sep-05 6:32 
GeneralRe: what about x = x++; ? Pin
Chris Losinger15-Sep-05 6:52
professionalChris Losinger15-Sep-05 6:52 
AnswerRe: what about x = x++; ? Pin
David Crow15-Sep-05 6:37
David Crow15-Sep-05 6:37 
GeneralRe: what about x = x++; ? Pin
bugDanny15-Sep-05 6:55
bugDanny15-Sep-05 6:55 
GeneralRe: what about x = x++; ? Pin
David Crow15-Sep-05 7:22
David Crow15-Sep-05 7:22 
GeneralRe: what about x = x++; ? Pin
bugDanny15-Sep-05 7:33
bugDanny15-Sep-05 7:33 
GeneralRe: what about x = x++; ? Pin
David Crow15-Sep-05 8:01
David Crow15-Sep-05 8:01 
GeneralRe: what about x = x++; ? Pin
bugDanny15-Sep-05 8:08
bugDanny15-Sep-05 8:08 
DavidCrow wrote:
bugDanny wrote:
cout << y;

What is displayed now.

Exactly what you told it to display, the value in y.


And the value in y was y = x++, and should have been 2, if, as you said, x++ incremented before assigning to y. It was not 2, but 1, showing that the postfix operator incremented after the assignment.

DavidCrow wrote:
Trivial or otherwise, using the postfix and assignment operators in this fashion is a sure recipe for disaster. I've never done it this way, and can't see myself doing it in the future.

I agree with you wholeheartedly, as I mentioned in one of my responses earlier. But the question was not should he do it, he asked what would happen if he did it.

Danny
GeneralRe: what about x = x++; ? Pin
ky_rerun15-Sep-05 9:14
ky_rerun15-Sep-05 9:14 

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.