ProgrammingHard
int arr[3] = {1, 2, 3}; int (*pa)[3] = &arr; printf("%d", (*pa)[2]); What is printed?
- A. 2
- B. 1
- C. 3
- D. 0
Correct answer: C. 3
pa points to the whole array, *pa is the array, and [2] selects its third element, 3.
More C Programming questions
- int spiralcount = 4 5; printf("%d", spiralcount); For a 4 x 5 matrix, how many cells does a full spiral visit?
- A program climbs a staircase of 5 steps, each move going up one or two steps. How many distinct ways are there?
- The number of subsets of a 4-element set with an even number of elements is what?
- The longest common subsequence of "abc" and "ac" has length?
- The sum of the entries of row 4 of Pascal's triangle (row 0 at the top) is what?
- How many 1s are on the main diagonal of a 4 x 4 identity matrix?