ProgrammingHard
int a[3][3] = {0}; int *p = a[1]; p[2] = 7; printf("%d", a[1][2]); What is printed?
- A. 0
- B. 1
- C. 2
- D. 7
Correct answer: D. 7
p points at the first element of row 1, so p[2] is a[1][2], which is set to 7.
More C Programming questions
- The number of ways to choose a 2 x 2 submatrix in a 4 x 4 matrix (choosing consecutive rows and columns) is what?
- Which of these statements about in-place transposition is correct?
- A table of size 5 uses h(k) = k % 5 with linear probing. Keys 15, 5, 10 and 3 are inserted in that order. How many slots are examined when…
- A hash table of size 5 uses h(k) = k mod 5 with linear probing. The keys 5, 10, 15 and 3 are inserted in that order into an empty table…
- A chained table has 4 buckets with h(k) = k % 4. Keys 1 and 5 are inserted with head insertion. Which key is first in bucket 1?
- A hash table starts with capacity 8 and doubles whenever the count exceeds half the capacity. After 9 insertions, what is the capacity?