Qustion about private

From: Southp (is91033_at_cis.nctu.edu.tw)
Date: 05/07/04

Date: Fri, 7 May 2004 07:51:39 +0800

Simple test:

class Person{
    int secret;

    void peeping_tom(Person b) {cout<<b.secret;}


int main(){
    Person john,bob;

In MinGW,this is compilable and executable.
I'm wonder is this the nature of C++ or compiler dependence?
John can peep Bob's secret without doubt?

Relevant Pages

  • Re: Why does compiler only look at public methods of superclasses of...?
    ... Compiler enumerates all methods in class A and all public methods ... in the superclasses of A to find methods named x ... if method is declared final, static or private then compiler knows ... override a protected method. ...
  • Question about use and host association
    ... IMPLICIT NONE ... PRIVATE ... SUBROUTINE mytype_Write ... Is this compiler message bogus, or am I misunderstanding something about use and/or host ...
  • random number code
    ... Will it really compile exactly the same as mingw compiler used ... // initialization of static private members ... MSBs of the seed affect only MSBs of the array ... // constructor with 32 bit int as seed ...
  • Re: Private return type of public functions
    ... itself, but the module "useType". ... The compiler already aborts during ... In the Fortran 95 draft at my disposal I've found a constraint ... result of a type that has PRIVATE accessibility shall have PRIVATE ...
  • Re: Manifesto against Vector
    ... There should be a way to make the defaults private. ... >That the compiler can tell me that it agrees with me here. ... My position is that in many cases "with" constitutes no contract. ... >>The problems are caused solely by renaming. ...