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

Discussion

A pointer to a block of memory is effectively same as an array

  • A.True
  • B.False

Answer: A

Correct answer: True

An array name in an expression yields a pointer to its first element, and a[i] is defined as *(a + i). So once you have a pointer to a block of memory you can subscript it exactly as you would an array. The two differ in what they are - an array is storage, a pointer is a variable holding an address - but for reading and writing elements they behave the same.

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

Post your comment

Please log in or register to post a comment.