Article View: de.comp.lang.c++
Article #24Re: reference variables
From: Andre Pareis
Date: Wed, 12 Aug 1992 15:36
Date: Wed, 12 Aug 1992 15:36
34 lines
1615 bytes
1615 bytes
In article <Aug.11.11.30.04.1992.28134@andromeda.rutgers.edu>, tmorgan@andromeda.rutgers.edu (Why? Only I Can Be Me) writes:
|> I do something similar to the following:
|> class X {
|> int &var ;
|> public:
|> constructor that initializes var...doesn't work.
|> destructor
|> rest of functions
|> .
|> .
|> .
|> } ;
|>
|> I don't remember the error that I am getting, as I am doing this from memory.
|> I hope that what I gave you helps solve my dilemma.
|>
|> Thanks,
|> Talib
In Tom Swan's 'Learning C++' I found some lines about this problem.
One must convert this reference into a pointer, then all should work.
I'll read this part again and then tell the solution, but, since I borrowed
the book it could take some time.
--
-----------------------------------------------
| Andr'e Pareis, |
| Internet: pareis@cs.tu-berlin.de |
| subiaagb@w350zrz.zrz.tu-berlin.de |
-----------------------------------------------
Technical Details
Message-ID:
<2QZ5GEP@mailgzrz.tu-berlin.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!zrz.tu-berlin.de!w350zrz!subiaagbReferences:
<39478.920808@nasobem.stgt.sub.org> <Aug.11.11.30.04.1992.28134@andromeda.rutgers.edu>Show Full Headers
Complete Article Headers
Newsgroups: de.comp.lang.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!zrz.tu-berlin.de!w350zrz!subiaagb From: subiaagb@w350zrz.tu-berlin.de (Andre Pareis) Subject: Re: reference variables Message-ID: <2QZ5GEP@mailgzrz.tu-berlin.de> Sender: subiaagb@w350zrz (Andre Pareis) Nntp-Posting-Host: w350zrz.zrz.tu-berlin.de Reply-To: pareis@cs.tu-berlin.de Organization: Dept. of CS, Techn. University Berlin References: <39478.920808@nasobem.stgt.sub.org> <Aug.11.11.30.04.1992.28134@andromeda.rutgers.edu> Date: Wed, 12 Aug 1992 15:36:27 GMT Lines: 34