Given int arr[3][4][2] = {{{2,4},{7,8},{3,4},{5,6}}, {{7,6},{3,4},{5,3},{2,3}}, {{8,9},{7,2},{3,4},{5,1}}}; which of the following can be used to refer to the element 1?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. *(*(*(arr + 2) + 3) + 1)
Explanation
The value 1 is arr[2][3][1], which in pointer form is *(*(*(arr + 2) + 3) + 1). arr[3][4][2] and arr[2][3][2] are out of bounds.
More Programming Languages and Computer Graphics questions
- Which of the following is correct using the constructor? A. string s1; B. string s2 (s1); C. string s3{7}; D. string s4{'a'}; E. string s5{…
- Match List I with List II
- Which of the following is wrong about the data types?
- If a constructor 'Date' is declared explicitly and has to be defined outside the class, which of the Q following is correct?
- Given a vector with Cartesian components (x, y), if scaling is done with the matrix [0.5 0; 0 1.5], which of the following are true? 1. Dec…
- Match the List-I and List-II d.To gain access to IV. to use explicit differing instances for casting derived classes through base we have C…