Aliasing in the context of programming languages refers to
Option is A.
In computer programming, aliasing refers to the situation where the same memory location can be accessed using different names. For instance, if a function takes two pointers A and B which have the same value, then the name A aliases the name B.
B)multiple variables having the same value
C)multiple variables having the same identifier
D)multiple uses of the same variable
A)multiple variables having the same memory location
This example also good http://www.cs.uregina.ca/Links/class-info/cplusplus/Standards/Disk10/aliasing_c.html
Try running this code- http://ide.geeksforgeeks.org/ccAyN2
Example of multiple variables having the same identifier -
int t =10; // local variable of function fun1.
int t=11; // local variable of function fun2.
Can we define a pointer as a variable?
In question they are asking just for a variable and not pointer
do u mean. in union for a highest memory location , a memory will be created,
but in structure,we need to create memory for every variable
like told here
Aliasing describes a situation in which a data location in memory can be accessed through different symbolic names in the program.
Now I meant to say that-
Consider this union.
Here 8 Bytes of memory will be allocated for it. Say from 1000 to 1008.
Now we can access this memory location using &u.y and &u.z.
So can we say it aliasing?
Call by reference is the best example for that.
The tests are there but it ain't free. Cost is...