How many types of the array are there in the C++ programming language?
2023
How many types of the array are there in the C++ programming language?
- A.
There are three types of arrays
- B.
There are four types of arrays
- C.
There are two types of arrays
- D.
More than one of the above
- E.
None of the above
Attempted by 256 students.
Show answer & explanation
Correct answer: A
In C++, arrays are classified based on their dimensions. The three main types are:
One-dimensional array: A linear array with a single index.
Two-dimensional array: A matrix-like structure with two indices.
Multi-dimensional array: Arrays with more than two dimensions, such as three-dimensional arrays.
Thus, there are three types of arrays in C++ based on dimensionality.
हिन्दी उत्तर:
C++ में एरे को उनके आयामों के आधार पर वर्गीकृत किया जाता है। तीन मुख्य प्रकार हैं:
एक आयामी एरे: एक रैखिक एरे जिसमें एक इंडेक्स होता है।
द्वि-आयामी एरे: दो इंडेक्स वाला मैट्रिक्स-जैसा संरचना।
बहु-आयामी एरे: तीन या अधिक आयामों वाले एरे, जैसे त्रि-आयामी एरे।
इस प्रकार, C++ में आयाम के आधार पर तीन प्रकार के एरे होते हैं।