Podcast
Questions and Answers
What is an array in C++?
What is an array in C++?
- A collection of variables of different types
- A collection of data accessed by unique identifiers
- A series of elements of different types
- A series of elements of the same type placed in contiguous memory locations (correct)
How is an array declared in C++?
How is an array declared in C++?
- arrayName [ arraySize ] type;
- type arrayName = arraySize;
- type arrayName [ arraySize ]; (correct)
- arraySize type arrayName;
What is the index of the first element in a C++ array?
What is the index of the first element in a C++ array?
- Depends on the number of elements
- n-1
- 0 (correct)
- 1
How is the last element of an array accessed in C++ with n elements?
How is the last element of an array accessed in C++ with n elements?
What is the maximum number of elements that the two dimensional array 'x' can hold?
What is the maximum number of elements that the two dimensional array 'x' can hold?
In C++, how do you create a two dimensional array with initial values?
In C++, how do you create a two dimensional array with initial values?
What happens if you try to access array elements outside of its bound in C++?
What happens if you try to access array elements outside of its bound in C++?
What does the given function in the C++ program do when the contents of the array are passed into it?
What does the given function in the C++ program do when the contents of the array are passed into it?