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

Discussion

Interning identifier strings so that equal names share one copy allows

  • A.the symbol table to be dispensed with altogether in the compiler
  • B.the compiler to avoid computing any hash values
  • C.identifiers of unlimited length to be forbidden
  • D.name comparison to be done by pointer rather than by characters

Answer: D

Comparing pointers is far cheaper than comparing strings, and comparisons are frequent. The interning table is itself usually a hash table over the character strings. The same table often serves as the compiler's whole string pool.

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

Post your comment

Please log in or register to post a comment.