Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What Is Dynamic Array In VB And How It Is Used?

array Dynamic Used VB
0
Posted

What Is Dynamic Array In VB And How It Is Used?

0

Array whose size can be changed at runtime is called dynamic array. The dynamic array is also sometimes called as redimmable array. This type of array is used to store a list of values which can shrink or extend during execution of program. Thus dynamic arrays are more flexible than the static/fixed size arrays. Unlike the fixed size array, the size of the dynamic array is not specified at the time of declaration as: Dim dynamicArray() as integer Where ‘dynamicArray’ is name of a dynamic array of integer type. The size of dynamic array is set by using a keyword ‘Redim’. The memory is allocated for array when the Redim is encountered (because the above declaration does not allocate memory space for the dynamic array). The Redim is used as: Redim dynamicArray(5) This statement allocates the memory for 6 array elements (if lower bound is 0). Otherwise we can specify both the upper bound and lower bound of array by using Redim as: Redim dynamicArray(1 to 5) The size of dynamic array can be

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123