Why pointer to a refernce is not allowed in C++?????
dilip.mathews
3
Junior Poster in Training
Recommended Answers
Jump to Postbecause you cannot take address of reference.
Jump to Postwho said you can't make a pointer to a reference?
void foo(int& x) { int* p = &x; *p = 0; }
If that is not what you mean then please post an example.
Jump to PostAncient Dragon:
You state that you can take address of a reference.
It is true that you can take the address of an expression formed of an identifier of a variable whose type is a reference type
In a sense, it is the address of the expression.
But can we …
Jump to PostHi Guys,
I still didn't get answer for my question.
By reference to pointer I mean this
int * & x;
Here x is a refernce to a pointer
This code is illegal because a reference has to be initialized not assigned. There are exceptions but in this case …
All 16 Replies
Grunt
19
Junior Poster
WolfPack
commented:
Good Comment
+3
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Grunt
19
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Grunt
19
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Grunt
19
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
SuperKoko
3
Newbie Poster
dilip.mathews
3
Junior Poster in Training
WolfPack
491
Posting Virtuoso
Team Colleague
Dave Sinkula
commented:
Very nice!
+7
dilip.mathews
3
Junior Poster in Training
WolfPack
491
Posting Virtuoso
Team Colleague
dilip.mathews
3
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.