If I test following code:
struct MyStruct
{
int number;
}
Console.WriteLine("{0}", default(MyStruct))
The result in console will be [some namespace].MyStruct
The question is how can I change the return of default(MyStruct) to something else?
You cannot change the behavior of the
defaultkeyword. It has predefined behavior for value, reference, and struct types.Source