I have this
function(array<Object^>^ a)
How do I know the length of this array? Like C++, the size has to come with the function?
Thanks,
Managed Arrays. Introduction. A managed array is a fixed collection of items that you store in the managed heap.
array::size() in C++ STL The introduction of array class from C++11 has offered a better alternative for C-style arrays. size() function is used to return the size of the list container or the number of elements in the list container.
Once an array has been allocated, there is no built-in mechanism for resizing it in the C++ programming language. Therefore, we can avoid this problem by dynamically generating a new array, copying over the contents, and then deleting the old array.
A typical declaration for an array in C++ is: type name [elements]; where type is a valid type (such as int, float ...), name is a valid identifier and the elements field (which is always enclosed in square brackets [] ), specifies the size of the array.
Function in your case:
function(array<Object^>^ a) {
auto len = a->Length
}
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