edited by
6,535 views
4 4 votes

Which of the following is true with respect to Reference?

  1. A reference can never be NULL
  2. A reference needs an explicit dereferencing mechanism
  3. A reference can be reassigned after it is established
  4. A reference and pointer are synonymous

2 Answers

Best answer
20 20 votes

A) References cannot be null,every reference refers to some object, although it may or may not be valid.

B) Reference doesn't need an explicit dereferencing mechanism

C) Once a reference is created, it cannot be later made to reference another object.

D) They are entirely different concept. Pointer stores the address whereas Reference is an alias of some variable.

https://en.wikipedia.org/wiki/Reference_(C%2B%2B)

selected by
Answer:
Position:
Show:

Related questions

3 3 votes
3 3 answers
4.9k
4.9k views
ajit asked Sep 20, 2015
4,941 views
Which of the following is NOT represented in a subroutine's activation record frame for a stack-based programming language?Values of local variablesReturn addressHeap are...
1 1 vote
3 3 answers
3.2k
3.2k views
ajit asked Aug 15, 2015
3,164 views
If only one memory location is to be reserved for a class variable, no matter how many objects are instantiated, then the variable should be declared asexternstaticvolati...
3 3 votes
4 answers 4 answers
7.3k
7.3k views
jenny101 asked Jun 25, 2016
7,302 views
The following three 'C' language statements is equivalent to which single statement?y=y+1; z=x+y; x=x+1z = x + y + 2;z = (x++) + (++y);z = (x++) + (y++);z = (x++) + (++y)...
10 10 votes
9 answers 9 answers
12.8k
12.8k views
pooja14 asked Jun 22, 2016
12,788 views
What is the output of the following C program? #include<stdio.h #define SQR(x) (x*x) int main() { int a; int b=4; a=SQR(b+2); printf("%d\n",a); return 0; }14361820