Click here to Skip to main content
15,918,742 members
Home / Discussions / C#
   

C#

 
QuestionSPI_SETWORKAREA Problems Pin
AndyBob21-Mar-07 3:26
AndyBob21-Mar-07 3:26 
GeneralLayout Pin
V.21-Mar-07 2:52
professionalV.21-Mar-07 2:52 
GeneralRe: Layout Pin
Laxman Auti21-Mar-07 3:18
Laxman Auti21-Mar-07 3:18 
GeneralRe: Layout Pin
V.21-Mar-07 4:35
professionalV.21-Mar-07 4:35 
GeneralRe: Layout Pin
Laxman Auti21-Mar-07 5:01
Laxman Auti21-Mar-07 5:01 
Question++x + x and x + ++x [modified] Pin
Varibrus21-Mar-07 2:44
Varibrus21-Mar-07 2:44 
AnswerRe: ++x + x and x + ++x Pin
Stefan Troschuetz21-Mar-07 3:04
Stefan Troschuetz21-Mar-07 3:04 
AnswerRe: ++x + x and x + ++x Pin
Pete O'Hanlon21-Mar-07 3:08
mvePete O'Hanlon21-Mar-07 3:08 
It's all to do with prefix and postfix operators. If you break it down, you get the following:

++x is a prefix operator, so it performs the operation first - so it turns x from 1 into 2. Next, you add x again which is 2 by this stage.

In the case of z1, x is equal to 1 and then you add x back on, but increment it before you add it so the maths becomes 1 + 2.

Here's a one for you, what do you get with this:
int x2 = 1;
int z2 = x++ + x;


Deja View - the feeling that you've seen this post before.

AnswerRe: ++x + x and x + ++x [modified] Pin
Jimmanuel21-Mar-07 3:08
Jimmanuel21-Mar-07 3:08 
AnswerRe: ++x + x and x + ++x Pin
Laxman Auti21-Mar-07 3:32
Laxman Auti21-Mar-07 3:32 
QuestionMain form with always-on-top flag + dialog Pin
Dominik Reichl21-Mar-07 2:36
Dominik Reichl21-Mar-07 2:36 
AnswerRe: Main form with always-on-top flag + dialog Pin
Stefan Troschuetz21-Mar-07 2:45
Stefan Troschuetz21-Mar-07 2:45 
GeneralRe: Main form with always-on-top flag + dialog Pin
Dominik Reichl21-Mar-07 4:13
Dominik Reichl21-Mar-07 4:13 
GeneralRe: Main form with always-on-top flag + dialog Pin
Stefan Troschuetz21-Mar-07 4:31
Stefan Troschuetz21-Mar-07 4:31 
QuestionProgressive Disclosure Control in windows form using c# Pin
Kumar Subramanian21-Mar-07 2:03
Kumar Subramanian21-Mar-07 2:03 
AnswerRe: Progressive Disclosure Control in windows form using c# Pin
joon vh.21-Mar-07 5:11
joon vh.21-Mar-07 5:11 
QuestionConstructor is instance method? Pin
Russell Jones21-Mar-07 2:00
Russell Jones21-Mar-07 2:00 
AnswerRe: Constructor is instance method? Pin
Pete O'Hanlon21-Mar-07 3:09
mvePete O'Hanlon21-Mar-07 3:09 
GeneralRe: Constructor is instance method? Pin
Russell Jones21-Mar-07 3:19
Russell Jones21-Mar-07 3:19 
GeneralRe: Constructor is instance method? Pin
Pete O'Hanlon21-Mar-07 3:31
mvePete O'Hanlon21-Mar-07 3:31 
GeneralRe: Constructor is instance method? Pin
Russell Jones21-Mar-07 3:45
Russell Jones21-Mar-07 3:45 
GeneralRe: Constructor is instance method? Pin
Pete O'Hanlon21-Mar-07 3:49
mvePete O'Hanlon21-Mar-07 3:49 
Questionevents and remoting Pin
D2raghu21-Mar-07 1:46
D2raghu21-Mar-07 1:46 
AnswerRe: events and remoting Pin
KaineDunno21-Mar-07 2:10
KaineDunno21-Mar-07 2:10 
AnswerRe: events and remoting Pin
m@u21-Mar-07 2:34
m@u21-Mar-07 2:34 

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.