From: "Campbell, Rolf [SKY:1U32:EXCH]" Newsgroups: comp.os.msdos.djgpp Subject: Re: Qualifiers Date: Tue, 22 Feb 2000 10:58:09 -0500 Organization: Nortel Networks Lines: 39 Message-ID: <38B2B211.A9B9D72E@americasm01.nt.com> References: <200002211546 DOT HAA16127 AT www2 DOT xoommail DOT com> NNTP-Posting-Host: wmerh0tk.ca.nortel.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.72 [en] (X11; I; HP-UX B.10.20 9000/785) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Brian Ronk wrote: > Ok, now that my timing problam is fixed, I've got > a new one for you. I can't figure out the error > for the life of me. I have an Array class, so I > can get the size very easily, etc. I used it > inside another class, and wanted to use it in an > ostream, so I could save the info. My line is > this: > int size=map.Links.Size(); > The error is this: > passing 'const Array' as 'this' > argument for 'int Array::Size()' > discards qualifiers > > Any ideas what I need to do to fix this? Thanks > again. Yes. You need to add the 'const' qualifier to your 'Size' method. int Array::Size() const { //body } What that does, is pass 'this' as 'Array* const this' which means that you will not be able to modify any class members in that function. -- (\/) Rolf Campbell (\/)