C++ Programming - References - Discussion

Discussion Forum : References - General Questions (Q.No. 10)
10.
Which of the following statement is correct?
A referenced has to be de-referenced to access a value.
A referenced does not need to be de-referenced to access a value.
A referenced has to be double de-referenced to access a value.
Whether a reference should be de-referenced or not depends on the type of the reference.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
4 comments Page 1 of 1.

Sachin said:   6 years ago
De-reference means delete an address of the variable in memory.

Bhavadip Gothadiya said:   8 years ago
Hello @Shilpa.

Example:

#include<iostream>
using namespace std;
int main(){
int x=10;
int &y=x;
cout<<y;
}

Here delete y (I mean De-references is not needed automatically de-refer).

Shilpa said:   8 years ago
Can anyone give example for this?

Santhoshi said:   1 decade ago
Reference variable will be automatically dereferenced. No need to dereference.

Post your comments here:

Your comments will be displayed after verification.