42 votes 42 votes Aliasing in the context of programming languages refers to multiple variables having the same memory location multiple variables having the same value multiple variables having the same identifier multiple uses of the same variable Programming in C gatecse-2000 programming easy aliasing + – Kathleen asked Sep 14, 2014 • edited Oct 26, 2016 by go_editor Kathleen 24.8k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Akhilesh Singla commented Apr 18, 2018 reply Follow Share Option A. https://en.wikipedia.org/wiki/Aliasing_(computing) 1 votes 1 votes Gajanan Purud commented Sep 18, 2023 reply Follow Share A 0 votes 0 votes Subham640 commented Mar 17 reply Follow Share So Lets take an example of aliasing : int a = 10 ; int *p = &a ; int *q = &a ; Now pointers p and q are referencing to the same object a . Hence a is aliased , in simple terms it means that the memory location of a can be accessed using different names p and q . 1 votes 1 votes Please log in or register to add a comment.
Best answer 48 votes 48 votes 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. Prasanna answered Nov 13, 2015 • edited Jun 14, 2018 by Milicevic3306 Prasanna comment Share Follow See all 4 Comments See all 4 4 Comments reply mrinmoyh commented Apr 11, 2019 reply Follow Share In sql aliasing means temporarily rename a table.same concept in c ? 2 votes 2 votes Bhartendu Kumar commented Jul 8, 2020 reply Follow Share @MRINMOY_HALDER is sql a programming language as mentioned in the question? 0 votes 0 votes manish_pal_sunny commented Aug 11, 2020 reply Follow Share Bhartendu Kumar there is no programing language mentioned in the question. 0 votes 0 votes jatinsharma437 commented Nov 3, 2020 reply Follow Share For instance, if a function takes two pointers A and B which have the same value, then the name A aliases the name B. Can you give a code snippet for the above statement as it will make it more clear . 1 votes 1 votes Please log in or register to add a comment.
41 votes 41 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 srestha answered Jan 1, 2017 srestha comment Share Follow See all 19 Comments See all 19 19 Comments reply Show 16 previous comments srestha commented Aug 7, 2018 reply Follow Share @Soumya actually variable and identifier refers to same in C programming right? 1 votes 1 votes manikantsharma commented Jul 8, 2022 reply Follow Share you are right. 0 votes 0 votes Rajsukh Mohanty commented Nov 11, 2023 reply Follow Share @srestha the link that you have given, in there, there is the stmt. “ /* call SomeFunction with the Global Variable as a parameter */ ”. how can a global variable be defined inside the main function? Is it a typo? 0 votes 0 votes Please log in or register to add a comment.
16 votes 16 votes A OPTION _xor_ answered May 21, 2015 _xor_ comment Share Follow See all 4 Comments See all 4 4 Comments reply Anu007 commented Dec 4, 2017 reply Follow Share Call by reference is the best example for that. 3 votes 3 votes akash.dinkar12 commented Dec 19, 2017 reply Follow Share we can relate to SQL query also... SQL aliases are used to give a table, or a column in a table, a temporary name. 3 votes 3 votes prithatiti commented Jan 9, 2020 reply Follow Share C Programming Language does not allow call by reference. 0 votes 0 votes Bhartendu Kumar commented Jul 8, 2020 reply Follow Share @akash.dinkar12 is sql a programming language as mentioned in the question? SQL (Structured Query Language) is a database management language for relational databases. SQL itself is not a programming language. Though for argument's shake one may include it as programming language which maybe valid, but the spirit of the question is against it. 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes int i=10; int *p=&i; As long as p points to i, we say that *p is an alias for i. Aakash_ answered Jul 9, 2018 Aakash_ comment Share Follow See all 2 Comments See all 2 2 Comments reply Sambhrant Maurya commented Jan 16, 2019 reply Follow Share You sure? Because if i has a memory location 100 then p will point to i but p can have a different memory location, say 200. 0 votes 0 votes Bhartendu Kumar commented Jul 8, 2020 reply Follow Share @Sambhrant Maurya yes and for Option A to be true by this argument, variables here are 1. i 2. p only. And clearly, " multiple variables having the same memory location " (option A) is not the case here. Though the, memory location &i can be accessed by two ways : &i and *p. Logic of UNION gives OPTION A. Not this argument 0 votes 0 votes Please log in or register to add a comment.