Which of the following are false wuth respect to the manipulation of arrays?
An array can store homogeneous data
It is possible to sort the elements of an array
It is possible to increase the size of the array
An array can store heterogeneous data
Answers
Answered by
22
Answer:
Option 3 and 4
Explanation:
- It is not possible to increase the size of an array. However, you can create anew array of different size, copy the elements from the old array to the new one and the use the new reference.
- Array can only store homogeneous data. To store heterogeneous data in C/C++, you will have to use union in order to achieve that. But still array type will be same as the union type (homogeneous) and you will have to convert it back into the type you are expecting.
Answered by
0
The false statements are: It is possible to increase the size of the array.
An array can store heterogeneous data. (options 3 & 4)
- It is impossible to expand the size of an array. You can, however, make a new array of a different size, copy the items from the old one to the new one, and utilise the new reference.
- Only homogeneous data can be stored in an array. In order to store heterogeneous data in C/C++, you must utilise union. However, the array type will be the same as the union type (homogeneous), and you will have to convert it back to the expected type.
#SPJ3
Similar questions
Math,
5 months ago
Science,
5 months ago
Math,
10 months ago
Environmental Sciences,
10 months ago
Chemistry,
1 year ago