C++ 1. Which of the following statements about multidimensional arrays is NOT tr
ID: 665610 • Letter: C
Question
C++
1. Which of the following statements about multidimensional arrays is NOT true?
5 For dynamically allocated multidimensional arrays, you must allocate memory for each row individually
2. Which of the following expressions would result in getting the value of the second element of an array using pointers? The array is defined as follows.
int arr[] = {1,12,23,34};
TorF
Reference variables can be null
Pointer variables can be null
type** is the pointer type to use to pass a statically allocated 2D array to a function
You should return statically allocated arrays from functions
1 You can use a pointer to pass a dynamically allocated multidimensional array to a function.Explanation / Answer
1.
False: 3 You can only make arrays with up to 3 dimensions
Reason: We can create an array of any dimension
False: Multidimensional arrays are stored like a grid in memory
Reason: Multidimensional arrays are stored in a continuous(non-dymanic array) or non-continuous location(dynamic array)
2.
*(arr + 1);
*arr gives the first element, *(arr + 1) gives the second element and so on.
Reference variables can be null: False
Pointer variables can be null: True
type** is the pointer type to use to pass a statically allocated 2D array to a function: True
You should return statically allocated arrays from functions: False
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.