static int y; public:
point(int px=10) { x=px; y++;
} static int getpx(point a)
{ return(a.x); }
static int getpy(point b) { return(b.y); } void setx(int c)
{ x=c;
}
};
int point::y=0; void main() { point p[5];
for(int i=0;i<5;i++) p[i].setx(i); for (i=0;i<5;i++) { cout< } 3) #include \class sam { int x; public: 17 ( void setx(int i) { x=i; } int putx() { return x; } }; void main() { sam *p; sam s[3]; for(int i=0;i<3;i++) s[i].setx(i+4); p=s; for(i=0;i<3;i++) cout< putx()< 4) #include A(char *s) { a=new char[strlen(s)+1]; strcpy(a,s); cout< delete []a; cout<<\ } }; void main() { A x(\ 18 ( A *y=new A(\ delete y; } (5) #include A(int x=0):a(new int(x)){} ~A() {delete a;} int getA() {return *a;} void setA(int x) {*a=x;} }; void main() { A x1,x2(3); A *p=&x2; p->setA(x2.getA()+5); x1.setA(15+x1.getA()); cout< (6) #include