Click here to Skip to main content
12,953,865 members (47,026 online)

Welcome to the Lounge

   

For discussing anything related to a software developer's life. Technical discussions are encouraged, but click here to ask your programming questions.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: This explains that last meeting I was in Pin
Mark_Wallace20-Mar-13 23:22
memberMark_Wallace20-Mar-13 23:22 
GeneralDoes this language feature seem strange to anyone else? Pin
lewax0020-Mar-13 12:58
memberlewax0020-Mar-13 12:58 
GeneralRe: Does this language feature seem strange to anyone else? Pin
PIEBALDconsult20-Mar-13 13:43
memberPIEBALDconsult20-Mar-13 13:43 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0020-Mar-13 14:00
memberlewax0020-Mar-13 14:00 
GeneralRe: Does this language feature seem strange to anyone else? Pin
AspDotNetDev20-Mar-13 14:04
protectorAspDotNetDev20-Mar-13 14:04 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0020-Mar-13 14:11
memberlewax0020-Mar-13 14:11 
GeneralRe: Does this language feature seem strange to anyone else? Pin
PIEBALDconsult20-Mar-13 14:17
memberPIEBALDconsult20-Mar-13 14:17 
GeneralRe: Does this language feature seem strange to anyone else? Pin
Matthew Faithfull20-Mar-13 14:10
memberMatthew Faithfull20-Mar-13 14:10 
Believe it or not that's what I would expect.
Remember that C# has its roots in C++ and in C++ everything can be validly initialised with a 0. It's an odd rule and one that seldom gets mentioned but we actually make a deal of use it to do things like initializing structures with {0} apart from every null initialised pointer prior to C++11's nullptr constant, which evaluates to, you guessed it, 0.
In C++ Enums have no choice but to participate so enum types can also always be initialised with 0. It's so rare for enums not to have a zero valued member and for it to be an issue that I've never even considered what happens when an Enum with no zero valued member is initialised with 0 but I would expect it to 'work' in the sense of not raising more than a minor warning and to run and for the variable to have the value 0.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)

GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0020-Mar-13 14:13
memberlewax0020-Mar-13 14:13 
GeneralRe: Does this language feature seem strange to anyone else? Pin
Matthew Faithfull20-Mar-13 14:29
memberMatthew Faithfull20-Mar-13 14:29 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0020-Mar-13 14:39
memberlewax0020-Mar-13 14:39 
GeneralRe: Does this language feature seem strange to anyone else? Pin
Matthew Faithfull20-Mar-13 15:10
memberMatthew Faithfull20-Mar-13 15:10 
GeneralRe: Does this language feature seem strange to anyone else? Pin
Mike Winiberg21-Mar-13 22:14
memberMike Winiberg21-Mar-13 22:14 
GeneralRe: Does this language feature seem strange to anyone else? Pin
AspDotNetDev20-Mar-13 13:56
protectorAspDotNetDev20-Mar-13 13:56 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0020-Mar-13 14:06
memberlewax0020-Mar-13 14:06 
GeneralRe: Does this language feature seem strange to anyone else? Pin
AspDotNetDev20-Mar-13 14:09
protectorAspDotNetDev20-Mar-13 14:09 
GeneralRe: Does this language feature seem strange to anyone else? Pin
jschell21-Mar-13 10:04
memberjschell21-Mar-13 10:04 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0021-Mar-13 10:27
memberlewax0021-Mar-13 10:27 
GeneralRe: Does this language feature seem strange to anyone else? Pin
César de Souza22-Mar-13 0:43
memberCésar de Souza22-Mar-13 0:43 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0022-Mar-13 10:58
memberlewax0022-Mar-13 10:58 
GeneralRe: Does this language feature seem strange to anyone else? Pin
englebart22-Mar-13 2:26
memberenglebart22-Mar-13 2:26 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0022-Mar-13 10:41
memberlewax0022-Mar-13 10:41 
GeneralRe: Does this language feature seem strange to anyone else? Pin
RafagaX22-Mar-13 6:40
memberRafagaX22-Mar-13 6:40 
GeneralRe: Does this language feature seem strange to anyone else? Pin
Chadwick Posey22-Mar-13 7:48
memberChadwick Posey22-Mar-13 7:48 
GeneralRe: Does this language feature seem strange to anyone else? Pin
lewax0022-Mar-13 10:45
memberlewax0022-Mar-13 10:45 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 28 May 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid