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

Discussion

Which keyword is used to prevent any changes in the variable within a C program?

  • A.immutable
  • B.mutable
  • C.const
  • D.volatile

Answer: C

Correct answer: const

const tells the compiler the object is not to be modified through that name, and an attempt to assign to it is diagnosed. volatile is the opposite kind of promise - that the object may change by means the compiler cannot see - and mutable and immutable are not C keywords at all.

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

Post your comment

Please log in or register to post a comment.