int?
-
When i was going thro the null types in C# i came across a statement which i had never met in my life ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_csref/html/e473cb01-28ca-42be-9cea-f717055d72c6.htm THe line is static void Main() { int? num = null; } What does the int? mean..
Proud To Be an Indian
-
When i was going thro the null types in C# i came across a statement which i had never met in my life ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_csref/html/e473cb01-28ca-42be-9cea-f717055d72c6.htm THe line is static void Main() { int? num = null; } What does the int? mean..
Proud To Be an Indian
-
When i was going thro the null types in C# i came across a statement which i had never met in my life ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_csref/html/e473cb01-28ca-42be-9cea-f717055d72c6.htm THe line is static void Main() { int? num = null; } What does the int? mean..
Proud To Be an Indian
vivekphlp wrote:
int? num = null;
The value gives the clue. int? is a shortcut for INullable<int>, which is to say, a wrapper class that wraps an int, or null, which allows you to store null for an int value. You can put the ? after any value type as in double? or Decimal?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
When i was going thro the null types in C# i came across a statement which i had never met in my life ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_csref/html/e473cb01-28ca-42be-9cea-f717055d72c6.htm THe line is static void Main() { int? num = null; } What does the int? mean..
Proud To Be an Indian
-
When i was going thro the null types in C# i came across a statement which i had never met in my life ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_csref/html/e473cb01-28ca-42be-9cea-f717055d72c6.htm THe line is static void Main() { int? num = null; } What does the int? mean..
Proud To Be an Indian
int? num = null; The meaning of the int? is represent the num is nothing there no mermory alocatin for the num the space of the num is empty.It is mainy used for DATA Base activity.
Continue...
-
int? num = null; The meaning of the int? is represent the num is nothing there no mermory alocatin for the num the space of the num is empty.It is mainy used for DATA Base activity.
Continue...
This is not true at all. The memory is allocated, and the memory for the wrapper generic class that int? is a shortcut to, is also allocated. It's simply set up so that the initial value is null, which means that whatever value the int has ( an int cannot be null ), the wrapper class will not expose it, because it regards the value to be null intead.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
This is not true at all. The memory is allocated, and the memory for the wrapper generic class that int? is a shortcut to, is also allocated. It's simply set up so that the initial value is null, which means that whatever value the int has ( an int cannot be null ), the wrapper class will not expose it, because it regards the value to be null intead.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Christian Graus wrote:
The memory is allocated, and the memory for the wrapper generic class that int? is a shortcut to, is also allocated
SO you mean to say when we write int?num; // allocates 4 bytes of memory but requires an initial assignment. But "int?" is a "SHORTCUT to WHAT ???" is it System.Nullable<int> variable
Proud To Be an Indian
modified on Tuesday, April 8, 2008 4:32 AM
-
Christian Graus wrote:
The memory is allocated, and the memory for the wrapper generic class that int? is a shortcut to, is also allocated
SO you mean to say when we write int?num; // allocates 4 bytes of memory but requires an initial assignment. But "int?" is a "SHORTCUT to WHAT ???" is it System.Nullable<int> variable
Proud To Be an Indian
modified on Tuesday, April 8, 2008 4:32 AM
vivekphlp wrote:
But Graus "int?" is a "SHORTCUT to WHAT ???" is it System.Nullable variable
Yes. BTW, referring to people by their surname is considered rude in the West. Just saying....
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
vivekphlp wrote:
But Graus "int?" is a "SHORTCUT to WHAT ???" is it System.Nullable variable
Yes. BTW, referring to people by their surname is considered rude in the West. Just saying....
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Not at all, like I said I'm just saying. I understand that it's just a cultural difference between our countries, but, I thought it worth pointing out, because someone else might be offended.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )