Question discussion

In the context of array types, what is the key difference between int *arr[5] and int (*arr)[5]?

358841Medium DSSSB TGT Computer Science 0 replies 0 views
0
In the context of array types, what is the key difference between int *arr[5] and int (*arr)[5]?
  • ABoth are syntactically incorrect
  • BFirst is a pointer to an array, second is an array of pointers
  • CThey are identical in their functionality
  • DFirst is an array of pointers to integers, second is a pointer to an array of integers
Correct answer: D

Explanation

int *arr[5] is an array of 5 pointers to int, while int (*arr)[5] is a pointer to an array of 5 ints.

Discussion 0

Nobody has replied yet. Start the discussion!