Can I set null into char
data type? and also DateTime
in C#? thanks guys!
It is impossible, it is a value type. Use
char? myChar = null;
DateTime? myDate = null;
which is equivalent to
Nullable<char> myChar = null;
Nullable<DateTime> myDate = null;
You cannot. These are value types and cannot be null
.
However, you could use char?
and DateTime?
instead. The ?
makes a type nullable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With