The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+15 votes
1.2k views

Aliasing in the context of programming languages refers to

  1. multiple variables having the same memory location
  2. multiple variables having the same value
  3. multiple variables having the same identifier
  4. multiple uses of the same variable
asked in Programming by Veteran (68.8k points)
edited by | 1.2k views

4 Answers

+17 votes
Best answer

OPTION A

In computer programmingaliasing 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 .

answered by Loyal (4.8k points)
edited by
+15 votes
A OPTION
answered by Junior (577 points)

Call by reference is the best example for that.

we can relate to SQL query also...

SQL aliases are used to give a table, or a column in a table, a temporary name.
+15 votes

B)multiple variables having the same value

int a=24;
int b=24;
int c=24;

 C)multiple variables having the same identifier

int a=23;
char a='A';

D)multiple uses of the same variable

int a=23;
 a=a*a;

A)multiple variables having the same memory location

int a=20;
int *p=&a;

This example also good http://www.cs.uregina.ca/Links/class-info/cplusplus/Standards/Disk10/aliasing_c.html

answered by Veteran (76.6k points)
@srestha Is your example for option (C) allowed in code?
why will it not allow?

Try running this code- http://ide.geeksforgeeks.org/ccAyN2

yes, it is giving error because C doesnot allow multiple variable with same name

it is the example, what option C) is telling
As far as I know option (C) can't be implemented in real. Correct me if I am wrong.
–4 votes
ans c)
answered by Boss (5.1k points)
Option a is more appropriate.


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,470 questions
39,199 answers
109,000 comments
36,575 users