I read somewhere that using new to instantiate a struct assigns default values to all of the instance's variables. Does it imply that a struct will have its values initialized through a default hidden constructor?
Does it imply that a struct will have its values initialized through a default hidden constructor?
Yes, in the sense that all member fields will be set to their default(T) values.
In practice, the compiler could just do something like memset(ptr, 0, sizeInBytes) . What actually happens is an implementation detail.
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