Since DateTime is struct other than class, each time when we use DateTime abc = DateTime.Now, there are two copies of DateTime structs?
One instance is created by DateTime struct internally, which represents the current time, and another instance is copied from the internal instance to the value type variable abc when we perform assignment operation?
I think the internal instance is a waste? Since it is useless when the value is copied to variable abc?
thanks in advance,
There's nothing internal, it's just a chunk of data (8 bytes unless mistaken).
Not really much different than typing:
(MaxValue being a constant rather than a property, but principle's the same)
int abc = int.MaxValue;
Unlike C++, a struct has not much in common with a class