What is the purpose of a symbol table in a compiler ?
2024
What is the purpose of a symbol table in a compiler ?
- A.
Stores machine code instructions for each source code segment
- B.
Tracks the names, types, and memory locations of variables
- C.
Manages program execution and function calls
- D.
Optimizes the generated code for faster execution
Attempted by 82 students.
Show answer & explanation
Correct answer: B
A symbol table in a compiler is used to track variable names, types, and memory locations.