When creating an array like with
string[] list = new string[5];
There is a variable named IsFixedSize. So is it possible to create an array that is not fixed size? The only way I know is by using List<string>.
I am confused because I thought arrays are about being fixed size, so why is there a list.IsFixedSize?
No, all arrays are fixed in size. If you read the docs on the property though, it explains why:
Property Value
Type: System.Boolean
This property is always true for all arrays.
And:
Array implements the
IsFixedSizeproperty because it is required by theSystem.Collections.IListinterface
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