Õ
ÕÅÖ¾¸Õ
#include "stdio.h"
#include "conio.h"
class INT
{
public:
int p;
INT(int a)
(a){printf("%d.p= %d\r\n",(int)this,p);}
};
class C
{
public:
INT c;
C():c(0){}
C(int a):c(a){ C(); }
};
void main()
{
C cc(9);
printf("%d.c=%d\r\n",(int)&cc,cc.c.p); //how many is this p £¿9£¿0£¿
getch();
}
look at the result printed:
1245052.p= 9
1244956.p= 0
1245052.c=9
the result of c is 9. why are there to address of p? 1245052.p= 9
1244956.p= 0
#include "conio.h"
class INT
{
public:
int p;
INT(int a)
};
class C
{
public:
INT c;
C():c(0){}
C(int a):c(a){ C(); }
};
void main()
{
C cc(9);
printf("%d.c=%d\r\n",(int)&cc,cc.c.p); //how many is this p £¿9£¿0£¿
getch();
}
look at the result printed:
1245052.p= 9
1244956.p= 0
1245052.c=9
the result of c is 9. why are there to address of p? 1245052.p= 9
1244956.p= 0