|
#include <stdio.h>
class B {
friend A;
int b;
void dispprivate() { printf("b=%d\n",b); }
public:
B() { b =3229; }
};
class A {
int a;
void dispprivate() { printf("a=%d\n",a); }
public:
A() { a=1234; }
void disppublic() {
B b;
A *pa;
pa = this;
pa->a++;
pa->dispprivate();
// fprintf(stderr,"Intentinnal error below b.dispprivate()\n");
b.dispprivate();
}
};
main()
{
A obja;
obja.disppublic();
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.