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

Discussion

Array base address in C language

  • A.Base address is the address of 0th index element.
  • B.An array b[] base address is &b[1]
  • C.An array b[] base address can be printed with printf("%d", b);
  • D.None of the above

Answer: A

Correct answer: Base address is the address of 0th index element.

The base address of an array is simply where its first element sits - the address of the element at index 0. Every subscript is computed from it: a[i] lives at \(\text{base} + i \times \text{sizeof(element)}\), which is why index 0 costs no offset at all.

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

Post your comment

Please log in or register to post a comment.