From -1709524519945565145
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,24391b79cbddb10b
X-Google-Attributes: gidf78e5,public
From: glascock@esd.dl.nec.com (Trent Glascock)
Subject: Re: Student needing help with C++ function overloading???
Date: 1995/04/25
Message-ID: <3nj5q9$krm@bsdsun.esd.dl.nec.com>#1/1
X-Deja-AN: 101492118
references: <3n8rd9$146@warp.cris.com> <3n8vnm$83j@fsgm01.fnal.gov> <3nb582$l1v@warp.cris.com>
organization: Engineering and Support Division, NEC, Inc.
mime-version: 1.0
newsgroups: comp.std.c++

In article <3nb582$l1v@warp.cris.com>, mshafiq@aol.comORshafiq@cris.com says...
>This gives me an error :  
>member 'number::val' of class 'number' is not accessible. 
>Obviously because 'val' can only be accessed by member functions of class   
>number! So my dilemma is, how can I get an overloaded sqrt() function to   
>take and return parameters of type number?

Make the overloaded function a *friend*.

-- 
Trent Glascock
glascock@esd.dl.nec.com




