Click here to Skip to main content
15,906,624 members
Home / Discussions / C#
   

C#

 
AnswerRe: Adding Item to ListBox from another class Pin
Christian Graus7-Jul-08 6:54
protectorChristian Graus7-Jul-08 6:54 
GeneralRe: Adding Item to ListBox from another class Pin
Paul Conrad7-Jul-08 8:26
professionalPaul Conrad7-Jul-08 8:26 
GeneralRe: Adding Item to ListBox from another class Pin
MAW307-Jul-08 9:44
MAW307-Jul-08 9:44 
AnswerRe: Adding Item to ListBox from another class Pin
Xmen Real 7-Jul-08 7:09
professional Xmen Real 7-Jul-08 7:09 
Questionstatic field initialization Pin
humayunlalzad7-Jul-08 6:15
humayunlalzad7-Jul-08 6:15 
AnswerRe: static field initialization Pin
Xmen Real 7-Jul-08 6:31
professional Xmen Real 7-Jul-08 6:31 
AnswerRe: static field initialization Pin
Giorgi Dalakishvili7-Jul-08 6:35
mentorGiorgi Dalakishvili7-Jul-08 6:35 
AnswerRe: static field initialization Pin
User 66587-Jul-08 6:53
User 66587-Jul-08 6:53 
If your question was, why the value is 0 although it has nowhere been initialized, then the C# language specification[^] tells you why:


5.2 Default values
The following categories of variables are automatically initialized to their default values:

* Static variables.
* Instance variables of class instances.
* Array elements.

The default value of a variable depends on the type of the variable and is determined as follows:

* For a variable of a value-type, the default value is the same as the value computed by the value-type’s default constructor (§4.1.2).

* For a variable of a reference-type, the default value is null.

Initialization to default values is typically done by having the memory manager or garbage collector initialize memory to all-bits-zero before it is allocated for use. For this reason, it is convenient to use all-bits-zero to represent the null reference.



regards

modified 12-Sep-18 21:01pm.

GeneralRe: static field initialization Pin
humayunlalzad7-Jul-08 7:21
humayunlalzad7-Jul-08 7:21 
GeneralRe: static field initialization Pin
User 66587-Jul-08 7:34
User 66587-Jul-08 7:34 
Questiongenerate a Console.Readline Pin
Martijn van Kleef7-Jul-08 6:06
Martijn van Kleef7-Jul-08 6:06 
AnswerRe: generate a Console.Readline Pin
leppie7-Jul-08 6:35
leppie7-Jul-08 6:35 
Questionparsing associated program path from registry ? Pin
Xmen Real 7-Jul-08 5:45
professional Xmen Real 7-Jul-08 5:45 
AnswerRe: parsing associated program path from registry ? Pin
led mike7-Jul-08 5:49
led mike7-Jul-08 5:49 
GeneralRe: parsing associated program path from registry ? Pin
Xmen Real 7-Jul-08 6:15
professional Xmen Real 7-Jul-08 6:15 
AnswerRe: parsing associated program path from registry ? Pin
PIEBALDconsult7-Jul-08 15:43
mvePIEBALDconsult7-Jul-08 15:43 
GeneralRe: parsing associated program path from registry ? Pin
Xmen Real 7-Jul-08 17:00
professional Xmen Real 7-Jul-08 17:00 
GeneralRe: parsing associated program path from registry ? Pin
PIEBALDconsult7-Jul-08 18:31
mvePIEBALDconsult7-Jul-08 18:31 
GeneralRe: parsing associated program path from registry ? Pin
Xmen Real 7-Jul-08 18:35
professional Xmen Real 7-Jul-08 18:35 
GeneralRe: parsing associated program path from registry ? Pin
PIEBALDconsult7-Jul-08 18:52
mvePIEBALDconsult7-Jul-08 18:52 
QuestionPassing value to base class Pin
humayunlalzad7-Jul-08 5:41
humayunlalzad7-Jul-08 5:41 
AnswerRe: Passing value to base class Pin
led mike7-Jul-08 5:51
led mike7-Jul-08 5:51 
AnswerRe: Passing value to base class Pin
leppie7-Jul-08 5:53
leppie7-Jul-08 5:53 
AnswerRe: Passing value to base class Pin
Richard Blythe7-Jul-08 6:07
Richard Blythe7-Jul-08 6:07 
QuestionNon-admin user writing files Pin
Richard Blythe7-Jul-08 5:39
Richard Blythe7-Jul-08 5:39 

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.