Noob Q: int?

  • Thread starter Thread starter dllhell
  • Start date Start date
D

dllhell

hello all,

would you like to explain what's mean "int?"
I have find it in funcion declarations but in msdn I can't find anything
useful by typing "int?" (msdn reurns everithing where "int" appears)

thanks in advance
sorry for questions like this...
 
dllhell said:
would you like to explain what's mean "int?"
I have find it in funcion declarations but in msdn I can't find anything
useful by typing "int?" (msdn reurns everithing where "int" appears)

int? means System.Nullable<int>
That should help you find it in MSDN.
 
int is a number type, it's short for integer. It ranges from
-2,147,483,648 to 2,147,483,647.

You may wish to pick up a C# book that will explain it far better and in
more depth than you'll find in this newsgroup.

- Mark
 
dllhell said:
would you like to explain what's mean "int?"
I have find it in funcion declarations but in msdn I can't find anything
useful by typing "int?" (msdn reurns everithing where "int" appears)

thanks in advance
sorry for questions like this...

No need to be sorry - C# 2.0 is still pretty new, and there's a lot to
learn in it.

int? is a shorthand for Nullable<int>. If that doesn't shed a lot of
light, see
http://www.pobox.com/~skeet/csharp/csharp2/nullable.html

Jon
 
So "int" can be assigned null value in v2.0.

I wonder what "simple" type is left there... perheps pointer only?
 
Hi,

In addition to the other posts here if you are working with 2.0 you better
use msdn2.microsoft.com , there if you write int? in the search box the
first result you get is what you are after.
 
Hi,


Lau Lei Cheong said:
So "int" can be assigned null value in v2.0.

No, you cannot assign null to an integer.
What you have is a new class Nullable<T> T:ValueType

so you can have Nullable<int> and have a new type that behave almost like a
"regular" int and can be nullable.

int? is just a shortcut that the compiler translate in the above
construction
I wonder what "simple" type is left there... perheps pointer only?
Exactly the same :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top