C++ Programming - References - Discussion

Discussion Forum : References - General Questions (Q.No. 6)
6.
A reference is declared using the _____ symbol.
&&
&
||
!
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
4 comments Page 1 of 1.

Srirock said:   10 years ago
Then in call by reference why do we write &&? I think option A is correct.

Gangaraju said:   1 decade ago
With the new standard (c++ 11) even the option 1 is correct.

Amit Singh Bisht said:   1 decade ago
& I known as (address of) operator. Which provides address of a variable.

Example 1:
Thus when we write,

int a;
scanf("%d",&a); This ,means we are taking the value to get stored in the (address of a).

Example 2:

int *a, b =10;
a = &b;

Similarly when we store a reference of a variable to a pointer, this means we are storing the address of that variable to a pointer.

Nani said:   1 decade ago
A reference variable is created as follows.

Data-type & reference-name = variable-name.

Post your comments here:

Your comments will be displayed after verification.