Click here to Skip to main content
16,012,061 members
Home / Discussions / C#
   

C#

 
AnswerRe: quick syntax question Pin
Luc Pattyn26-Apr-10 7:57
sitebuilderLuc Pattyn26-Apr-10 7:57 
AnswerRe: quick syntax question Pin
Michel Godfroid26-Apr-10 8:02
Michel Godfroid26-Apr-10 8:02 
AnswerRe: quick syntax question Pin
Henry Minute26-Apr-10 8:16
Henry Minute26-Apr-10 8:16 
GeneralRe: quick syntax question Pin
harold aptroot26-Apr-10 8:33
harold aptroot26-Apr-10 8:33 
GeneralRe: quick syntax question Pin
Henry Minute26-Apr-10 8:46
Henry Minute26-Apr-10 8:46 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 9:21
sitebuilderLuc Pattyn26-Apr-10 9:21 
GeneralRe: quick syntax question Pin
Michel Godfroid26-Apr-10 9:34
Michel Godfroid26-Apr-10 9:34 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 9:44
sitebuilderLuc Pattyn26-Apr-10 9:44 
There always is some potential for side-effects.

First example:

int v = ...;
int y = (v++==100) ? 0 : v;


will the auto-increment happen before or after the evaluation of the second/third operand?


Second example:

int y = someFlag ? method1() : method2();


We all hope this causes exactly one method to get executed; in general it is not equivalent to:

int v1=method1();
int v2=method2();
int y = someFlag ? v1 : v2;


as those methods could have all kinds of side-effects. However I did not see that stated explicitly in the spec.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.


JokeRe: quick syntax question Pin
Not Active26-Apr-10 10:07
mentorNot Active26-Apr-10 10:07 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 10:32
sitebuilderLuc Pattyn26-Apr-10 10:32 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 9:47
sitebuilderLuc Pattyn26-Apr-10 9:47 
GeneralRe: quick syntax question Pin
Michel Godfroid26-Apr-10 10:32
Michel Godfroid26-Apr-10 10:32 
GeneralRe: quick syntax question Pin
harold aptroot26-Apr-10 10:43
harold aptroot26-Apr-10 10:43 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 10:57
sitebuilderLuc Pattyn26-Apr-10 10:57 
GeneralRe: quick syntax question [modified] Pin
harold aptroot26-Apr-10 11:24
harold aptroot26-Apr-10 11:24 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 11:51
sitebuilderLuc Pattyn26-Apr-10 11:51 
GeneralRe: quick syntax question Pin
Michel Godfroid26-Apr-10 12:21
Michel Godfroid26-Apr-10 12:21 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 12:32
sitebuilderLuc Pattyn26-Apr-10 12:32 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 12:17
sitebuilderLuc Pattyn26-Apr-10 12:17 
GeneralRe: quick syntax question Pin
Luc Pattyn26-Apr-10 12:34
sitebuilderLuc Pattyn26-Apr-10 12:34 
AnswerRe: quick syntax question Pin
mprice21426-Apr-10 9:03
mprice21426-Apr-10 9:03 
Question"Fade Panel" control or method Pin
Jon Hulatt26-Apr-10 6:02
Jon Hulatt26-Apr-10 6:02 
AnswerRe: "Fade Panel" control or method Pin
Not Active26-Apr-10 6:18
mentorNot Active26-Apr-10 6:18 
AnswerRe: "Fade Panel" control or method [modified] Pin
Rutvik Dave26-Apr-10 7:14
professionalRutvik Dave26-Apr-10 7:14 
AnswerRe: "Fade Panel" control or method [modified] Pin
#realJSOP26-Apr-10 7:25
professional#realJSOP26-Apr-10 7:25 

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.