What is the purpose of a symbol table in a compiler ?

2024

What is the purpose of a symbol table in a compiler ?

  1. A.

    Stores machine code instructions for each source code segment

  2. B.

    Tracks the names, types, and memory locations of variables

  3. C.

    Manages program execution and function calls

  4. 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.

Explore the full course: Niacl Ao It Specialist