answersLogoWhite

0


Best Answer

Arrays whose size can be altered are known as dynamic arrays.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Arrays whose size can be altered are known as?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can an arrays size declarator be negative?

no


How can arrays be used for inter function communication?

The size of a function can be determined from the size of the array. Arrays and functions are both used in computer programming.


1 write a c function that takes a parameters two integer arrays and their sizeboth arrays are of the same size and returns a 1true if the arrays have the same contents or a 0 false if not?

int comp(const int a1[], const int a2[], const int size) { int i; for(i = 0; i < size; ++i) { if(a1[i] != a2[i]) { return 0; } } return 1; }


How do you handle object array?

Exactly as you would any other type of array. An object's size is determined in the same way a structure's size is determined, by the sum total size of its member variables, plus any padding incurred by alignment. However, you cannot create arrays of base classes. Arrays of objects can only be created when the class of object is final; a class that has a private default constructor, otherwise known as a "leaf" class. This is because derived classes can vary in size; array elements must all be the same size. To create an array of base classes you must create an array of pointers to those base classes instead. Pointers are always the same size (4 bytes on a 32-bit system). Static arrays are ideally suited to arrays of leaf objects where the number of objects never changes, or the maximum number of objects is finite and fixed. Although you can use dynamic arrays of leaf objects, you will incur a performance penalty every time the array needs to be resized, because every object's copy constructor must be called during the reallocation. Dynamic arrays are better suited to arrays of pointers to objects -- only the pointers need to be copied during resizing, not the objects they point to.


Why would you use the array of pointers to pointers?

You would use an array of pointers to pointers whenever you wished to implement a dynamic multi-dimensional array of 3 or more dimensions. Every multi-dimensional array can ultimately be reduced to a one-dimensional array where each element is itself a one-dimensional array (an array of arrays). With fixed-size arrays, all elements can be allocated contiguously regardless of how many dimensions there are. Fixed size arrays can be allocated both statically (when the size is known at compile time) or dynamically (when the size is unknown at compile time). However with large arrays it is often necessary to divide the array into smaller subarrays each of which is allocated separately (non-contiguously with each other) and maintain a separate array of pointers to keep track of each of those subarrays. Although this consumes more memory than a contiguously-allocated array would, it has the added benefit in that each subarray need not be the same length, thus it can actually save memory overall. However, if we had several such arrays then we would need yet another array in order to keep track of them all, and this array would need to be an array of pointers to pointers.

Related questions

What is the way by which you can make the user defined the size of the arrays?

By using the library function #define A[] we can define the size of arrays


Can an arrays size declarator be negative?

no


How can arrays be used for inter function communication?

The size of a function can be determined from the size of the array. Arrays and functions are both used in computer programming.


What is the required syntax for creating C arrays?

The required syntax for creating C arrays include the brackets, array size, variety length arrays, codes like std:vector, classPTR, and many more to create C arrays.


Is an array is a collection of characters that can be fixed or variable?

No. An array is a collection of objects of any type, such as doubles, not just characters. You can even have arrays of arrays, or arrays of structs. In C, the size of an array is fixed, but it is possible to write code that will allow you to manually make it variable in size.


What is memory leakage in terms of arrays?

leakage in arrays occur when you declare an array with big size and using only very few bytes.


1 write a c function that takes a parameters two integer arrays and their sizeboth arrays are of the same size and returns a 1true if the arrays have the same contents or a 0 false if not?

int comp(const int a1[], const int a2[], const int size) { int i; for(i = 0; i < size; ++i) { if(a1[i] != a2[i]) { return 0; } } return 1; }


How do you handle object array?

Exactly as you would any other type of array. An object's size is determined in the same way a structure's size is determined, by the sum total size of its member variables, plus any padding incurred by alignment. However, you cannot create arrays of base classes. Arrays of objects can only be created when the class of object is final; a class that has a private default constructor, otherwise known as a "leaf" class. This is because derived classes can vary in size; array elements must all be the same size. To create an array of base classes you must create an array of pointers to those base classes instead. Pointers are always the same size (4 bytes on a 32-bit system). Static arrays are ideally suited to arrays of leaf objects where the number of objects never changes, or the maximum number of objects is finite and fixed. Although you can use dynamic arrays of leaf objects, you will incur a performance penalty every time the array needs to be resized, because every object's copy constructor must be called during the reallocation. Dynamic arrays are better suited to arrays of pointers to objects -- only the pointers need to be copied during resizing, not the objects they point to.


What is the act of tolerance?

The maximum allowable size that can be altered.


What number has the most arrays?

You have array of type int with a name myArray, and you do not know size of the array.


Limiting factors whose effects increase as the size of the population increases are called what?

Limiting factors whose effects increase as the size of the population increases are known as density-dependent factors. Competition is an example of a density-dependent limiting factor.


What are Barbara mandrells measurements?

When she was performing she was an altered size 2.