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

Discussion

Consider the declaration

char street[10] = "abcdefghi";

Choose the correct remark(s)

  • A.&street and street will have different values
  • B.&street is meaningless
  • C.&street+1 and street+1 will have the same values
  • D.None of the above

Answer: D

Correct answer: None of the above

All three remarks are false.

  • &street and street hold the same address - the start of the array - and differ only in type.
  • &street is perfectly meaningful: it has type char (*)[10].
  • Because of that type, &street + 1 advances 10 bytes while street + 1 advances 1, so the two differ.

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

Post your comment

Please log in or register to post a comment.