Dom,
I think you mean that you can generally set any reference type to null
(you said can't). This is true, you can assign null to reference type
variables.
However, in this case, the compiler is telling you the truth. Rectangle
is a value type, not a reference type, and you can't assign null to it
(assuming that this is the Rectangle structure from the System.Drawing
namepspace).
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Dom" <do********@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
Why can't I say the following;
Rectangle r = null;
The compiler tells me that null is a value type and can't be converted
to Rectangle. But I can't generally set any reference type to null.
For example, I can say:
MyClass c = null;