Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!think.com!snorkelwacker.mit.edu!ira.uka.de!smurf!artcom0!hb.maus.de!hh.maus.de!Michael_Hoennig From: Michael_Hoennig@hh.maus.de (Michael Hoennig) Newsgroups: comp.lang.c Subject: const methods Message-ID: <4633@hh.maus.de> Date: 22 Jun 91 22:06:00 GMT Distribution: world,comp Organization: Maus Mailbox Netz - UUCP-Gateway Bremen Lines: 31 Hi Marina, MG> virtual int f() const; MG>Does anybody know the meaning of this const postfix ?? this method will not change the object to which this is pointing. If you will use const parameters of a class, you can only access these const-methodes: class X { int n; public: ... void theConst() const; void theOther(); ... }; void foo( const X aX ) { X.theConst(); // allowed X.theOther(); // not allowed, type mismatch error or warning } Adios -- Michael Hoennig -- Dobbelersweg 45 -- D-2000 Hamburg 26 -- ++49 40 219 24 58 office: mi1@starlab.UUCP -- ++49 40 23 08 56 (StarDivision Hamburg)