GATE / CS ARCHIVE

GATE CSE 2000 / QUESTION 1.16

Meaning of aliasing

Compiler Design · Runtime Environments & Parameter Passing · Full GATE CSE 2000 paper

GATE 2000, Q1.16 1 mark · MCQ
Report issue

Runtime Environments & Parameter Passing

Question 1.16, GATE 2000: Does aliasing mean multiple names for one memory location, equal values, repeated identifiers, or repeated use of a variable?
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step 1: Aliasing occurs when two accessible expressions designate the same storage object. For example, if p=&x, then x and *p refer to the same int.

Step 2: Assigning through either expression changes what the other observes. Two separate variables can hold equal values without aliasing, and the same identifier can name different objects in different scopes.

Thus A, not merely equal contents or repeated spelling.

Original paper, page 2