Click here to Skip to main content
15,892,517 members
Home / Discussions / C#
   

C#

 
GeneralRe: Starting a new project in C# Pin
FilipJ16-Feb-14 17:38
FilipJ16-Feb-14 17:38 
GeneralRe: Starting a new project in C# Pin
Mycroft Holmes16-Feb-14 17:56
professionalMycroft Holmes16-Feb-14 17:56 
GeneralRe: Starting a new project in C# Pin
FilipJ16-Feb-14 18:10
FilipJ16-Feb-14 18:10 
AnswerRe: Starting a new project in C# Pin
Peter Leow16-Feb-14 16:36
professionalPeter Leow16-Feb-14 16:36 
GeneralRe: Starting a new project in C# Pin
FilipJ16-Feb-14 17:45
FilipJ16-Feb-14 17:45 
AnswerRe: Starting a new project in C# Pin
V.16-Feb-14 21:22
professionalV.16-Feb-14 21:22 
GeneralRe: Starting a new project in C# Pin
FilipJ16-Feb-14 23:46
FilipJ16-Feb-14 23:46 
GeneralRe: Starting a new project in C# Pin
V.16-Feb-14 23:52
professionalV.16-Feb-14 23:52 
GeneralRe: Starting a new project in C# Pin
FilipJ17-Feb-14 0:02
FilipJ17-Feb-14 0:02 
AnswerRe: Starting a new project in C# Pin
Ravi Bhavnani17-Feb-14 7:49
professionalRavi Bhavnani17-Feb-14 7:49 
AnswerRe: Starting a new project in C# Pin
David C# Hobbyist.17-Feb-14 12:15
professionalDavid C# Hobbyist.17-Feb-14 12:15 
QuestionStruct vs Class? PinPopular
David C# Hobbyist.16-Feb-14 12:34
professionalDavid C# Hobbyist.16-Feb-14 12:34 
AnswerRe: Struct vs Class? Pin
Peter Leow16-Feb-14 13:29
professionalPeter Leow16-Feb-14 13:29 
AnswerRe: Struct vs Class? PinPopular
OriginalGriff16-Feb-14 21:29
mveOriginalGriff16-Feb-14 21:29 
GeneralRe: Struct vs Class? Pin
Nicholas Marty16-Feb-14 21:55
professionalNicholas Marty16-Feb-14 21:55 
GeneralRe: Struct vs Class? Pin
harold aptroot16-Feb-14 22:02
harold aptroot16-Feb-14 22:02 
GeneralRe: Struct vs Class? Pin
OriginalGriff16-Feb-14 22:17
mveOriginalGriff16-Feb-14 22:17 
GeneralRe: Struct vs Class? Pin
OriginalGriff16-Feb-14 22:26
mveOriginalGriff16-Feb-14 22:26 
They are and they aren't, but that's kinda the advanced school: who needs to know that
C#
i = i + 1;
creates a new integer instance and loads a copy into the original location?
Particularly when it doesn't - If you have a look at the IL it fetches the value, increments it, and stores the new value back - no new instance is explicitly created except in the sense that the load removes the early version instance from the stack and then iteh new value is put back in the same place:
.line 14,14 : 13,25 'int i = 777;'
IL_0001:  ldc.i4     0x309
IL_0006:  stloc.0
.line 15,15 : 13,23 'i = 1 + 1;'
IL_0007:  ldloc.0
IL_0008:  ldc.i4.1
IL_0009:  add
IL_000a:  stloc.0
But it does indeed behave as if they were, specifically to prevent constant values being modified by our code! Laugh | :laugh:
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

GeneralRe: Struct vs Class? Pin
harold aptroot16-Feb-14 22:59
harold aptroot16-Feb-14 22:59 
GeneralRe: Struct vs Class? Pin
OriginalGriff17-Feb-14 0:06
mveOriginalGriff17-Feb-14 0:06 
GeneralRe: Struct vs Class? Pin
harold aptroot17-Feb-14 0:16
harold aptroot17-Feb-14 0:16 
GeneralRe: Struct vs Class? Pin
jschell17-Feb-14 12:07
jschell17-Feb-14 12:07 
GeneralRe: Struct vs Class? Pin
BillWoodruff17-Feb-14 1:41
professionalBillWoodruff17-Feb-14 1:41 
AnswerStruct vs Class? (Off Topic) Pin
OriginalGriff17-Feb-14 0:41
mveOriginalGriff17-Feb-14 0:41 
GeneralRe: Struct vs Class? (Off Topic) Pin
David C# Hobbyist.17-Feb-14 11:12
professionalDavid C# Hobbyist.17-Feb-14 11:12 

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.