Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Reference to a reference

Reply
Thread Tools

Reference to a reference

 
 
Jim Langston
Guest
Posts: n/a
 
      10-31-2005

"Senthil" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi,
> I am reading Modern C++ Design where Anderi quoted "C++ does not allow
> references to references".
>
> Assume i have
> DoThat(const string& strData2)
> {
> ...
> }
>
> DoThis(const string& strData)
> {
> ..
> DoThat(strData);
> }
>
> int main()
> {
> string Data;
> DoThis(Data);
> }
>
> Now the strData i have inside DoThis is a reference to Data.The
> strData2 I have is a reference to strData.i.e strData2 is a reference
> to a reference.
> Here Andrei's statement confuses me..Am i missing something?
>
> Thanks,
> Senthil
>


char** MyPointer; could be considered a pointer to a pointer.
char&& MyReference; could be considered a reference to a reference, which is
illegal.


 
Reply With Quote
 
 
 
 
Oliver S.
Guest
Posts: n/a
 
      10-31-2005
> Also, references are necessary for operator overloading:

Not only operator-overloading but copy-constructors as well!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0: master pages and web user controls: reference to a non-shared member requires an object reference bminder ASP .Net 0 06-24-2005 12:22 AM
asp.net 2005 question re: "reference to a non-shared member requires an object reference" ce ASP .Net 1 06-23-2005 09:15 PM
web reference interfering with reference to component Dude ASP .Net 0 11-09-2004 11:53 AM
How to tell if a reference is project or file reference from within the IDE? Darren ASP .Net 0 10-11-2004 12:51 AM
Passing the value by reference is same as pointer by reference sam pal C++ 3 07-16-2003 09:14 PM



Advertisments