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

Discussion

In C, the name of an array used in an expression evaluates to ________.

  • A.the first element of the array
  • B.the address of the first element of the array
  • C.the number of elements in the array
  • D.the total size of the array in bytes

Answer: B

Correct answer: the address of the first element of the array

An array name decays to a pointer to its first element in almost every expression, which is why passing an array to a function passes only that address. The exceptions are the operands of sizeof and of the address-of operator.

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

Post your comment

Please log in or register to post a comment.