rculver9056
Newcomer
- Joined
- Apr 3, 2010
- Messages
- 3
I have been playing around with numbers in c# (learning!), and I wonder how I would go about making a struct of mine act like one of the built-ins (such as byte)
With a byte, I can go '(byte)value' to get a value within the byte range, 0..255.
My struct will have values 0..47,000 - I want to be able to go '(myType)value' to get it within that range, like with the byte.
Is this anything to do with the MinValue / MaxValue properties?
Could someone please suggest some ideas...?
Thanks
With a byte, I can go '(byte)value' to get a value within the byte range, 0..255.
My struct will have values 0..47,000 - I want to be able to go '(myType)value' to get it within that range, like with the byte.
Is this anything to do with the MinValue / MaxValue properties?
Could someone please suggest some ideas...?
Thanks