Machine-translated by Google. Questions are authored in English.
Top

Discussion

What is meaning of the following statement ?

int *ptr[20]

 

  • A.None of these
  • B.Integer Array to Integer Pointers having size 20
  • C.Array of Integer Pointers of size 20
  • D.Integer Array of size 20 pointing to an Integer Pointer

Answer: C

Correct answer: Array of Integer Pointers of size 20

Subscript binds more tightly than the dereference, so int *ptr[20] groups as int *(ptr[20]): an array of 20 pointers to int. A pointer to an array of 20 ints would need parentheses in the other place - int (*ptr)[20].

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.