James,
You can't use string as the type parameter for Nullable<Tbecau se there
is a constraint making it a structure. This makes sense, since reference
types can be null.
If you just make it a string, by default, the field will be null when
the structure is constructed. You don't need to initialize it, you just
have to declare it.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard. caspershouse.co m
"James" <bo************ *@gmail.comwrot e in message
news:9a******** *************** ***********@i20 g2000prf.google groups.com...
hello,
can we have a nullable type field in the struct ?
struct Employee
{
nullable<string firstName =null;
}
we can't initialize a field in a struct so is there any possibility
that we can have a nullable field in the struct.
can anyone please help me out regarding this
Thanks,
James