We are creating a simple struct with a constructor accepting one argument.
public struct test
{
public int val;
public test (int a)
{
val = a;
}
}
Yet I notice that the struct can be initialized using the default constructor. Can this be prevented?
test t1 = new test(); //why does this work?