![]() ![]() Depending on system configuration when you initialize an array, the common language runtime (CLR) can assign storage either to pack elements as close together as possible, or to align them all on natural hardware boundaries. Storage varies on platforms of different data widths, so the same array can consume more memory on a 64-bit system than on a 32-bit system. It is not safe to make any assumptions regarding how an array is stored in memory. The size always represents the total number of elements, not the number of bytes that they consume in memory. If you attempt to initialize an array that exceeds the amount of available memory, the runtime throws an OutOfMemoryException.Īn array's size is independent of the data type of its elements. However, the total size of an array is also limited by the memory available on your system. ![]() The length of every dimension of an array is limited to the maximum value of the Integer data type, which is Int32.MaxValue or (2 ^ 31) - 1. Therefore, the length of a given dimension is one greater than the declared upper bound of that dimension. The index of each dimension is 0-based, which means it ranges from 0 to its upper bound. There are several things to keep in mind when dealing with the size of an array. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |