ProgrammingModerate

char *grid[2] = {"ab", "cd"}; printf("%c", grid[1][0]); What is printed?

  1. A. d
  2. B. c
  3. C. a
  4. D. b

Correct answer: B. c

grid[1] is the second pointer, to "cd", and [0] picks its first character, 'c'. Swapping the indices gives grid[0][1] = 'b', and 'd' is grid[1][1].

More C Programming questions

Exams that ask this topic