, , ( ).
, .
class complex {
friend my_func(complex&);
friend another_class::method(complex&, int);
- , :
Friend class another_class;
.
, , :
#ifndef__Point2D_defined__
#define__Point2D_defined__class Point 2D{};
#endif
25.
. .
- , . - - , this.
:
1)
2) ( )
3)
4) const, volatite, virtual, static
5) ,
6) ,
7) , . .
Class Point{
private: double x,y;
public:
Point(); // , (???)
Point(double,double); //, .
Point::Point() {x=0;y=0;}
Point::Point(double ax, double ay) {x=ax; y=ay;}
:
class Point{
Point (double=0,double=0);
};
, 2 :
1)
2) , .
. ( )
, ..
private . private , .
, ,
complex c4=c2;
|
|
, , :
complex::complex(const complex& C)
{
Re = C.Re;
Im = C.Im;
}
, . , .
:
1) .
2)
3) ,
, . . , .