Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!samsung!usc!apple!excelan!sjsumcs!horstman From: horstman@sjsumcs.sjsu.edu (Cay Horstmann) Newsgroups: comp.lang.c++ Subject: Re: Modifying References Message-ID: <1989Nov30.053552.6149@sjsumcs.sjsu.edu> Date: 30 Nov 89 05:35:52 GMT References: <4280@cadillac.CAD.MCC.COM> <936@acf5.NYU.EDU> Reply-To: horstman@sjsumcs.SJSU.EDU (Cay Horstmann) Distribution: na Organization: San Jose State University Lines: 17 I always thought there was a perfectly simple reason why one can't modify a reference. How would you do it? int& r = a; // i.e. really r is a pointer, initialized with &a int n = r; // i.e. really n = *r r = 5; // i.e. really *r =5 Every time you write r, it really means *r. Therefore, there is NO WAY to change the reference. Well, I suppose it would be logical to allow &r = b; // now r a reference to b? but it would be quite unintuitive. Cay