3GL   4GL   5GL   .

- ++

, , , - , . , , .

( ). .

, . , , Point , Circle. , .

:
- ,
- ,
- .

private protected.

, , Circle,

Boolean Circle::IsInside(Point &P)
{
 if ((X-P.GetX())*(X-P.GetX())+(Y-P.GetY())*(Y-P.GetY())<= R*R) return true;
  else return false;
}

-. . -, GetX() GetY() P , - . X Y. X Y protected. , , IsInside() , , .

, , , .

, , (friend) . , friend.

friend , .

, .

Point Circle:

class Point
{
//...
 friend Boolean IsInside (Circle &C, Point &P);
};

class Circle: public Point
{
//...
 friend Boolean IsInside (Circle &C, Point &P);
};

,
friend Boolean IsInside (Circle &C, Point &P);
, (public, protected private).

:

Boolean IsInside(Circle &C, Point &P)
{
 if ((C.X-P.X)*(C.X-P.X)+(C.Y-P.Y)*(C.Y-P.Y)<= C.R * C.R) return true;
  else return false;
}

, IsInside(), ( , - ) Point Circle. . , , " ".

- .

class x
{
//...
void f();
};

class y
{
//...
friend void x::f();
};

, .

class y
{
//...
friend class x;
}

.

, _3d

class _3d
{
//...
 _3d operator + (_3d b);
};

_3d _3d::operator + (_3d b)
{
 _3d c;
 c.x = x + b.x;
 c.y = y + b.y;
 c.z = z + b.z;
 return c; }

, + .

class _3d
{
//...
 friend _3d operator + (_3d &a, _3d &b);
};

_3d operator + (_3d &a, _3d &b)
{
 _3d c;
 c.x = a.x + b.x;
 c.y = a.y + b.y;
 c.z = a.z + b.z;
 return c;
}

, , . , , , , .

, : , , , .

. "=", "++" "+=" , , -, , . , , , , , . , "+", "", "||" .

,

class X {...};
X x;
x=1+x;  // .. x = 1.operator + (x);

"+" . .

, , -, . , .

        3GL   4GL   5GL   .

, , Class diagram - - , - .




 21.01.2021 - 08:17: , , - Upbringing, Inlightening, Education -> - _.
21.01.2021 - 07:59: , , - Upbringing, Inlightening, Education -> - _.
20.01.2021 - 17:39: , , - Upbringing, Inlightening, Education -> - _.
19.01.2021 - 12:55: - Conscience -> . ? - _.
18.01.2021 - 11:33: - Personalias -> WHO IS WHO - - _.
18.01.2021 - 09:05: , - War, Politics and Science -> . - _.
18.01.2021 - 08:21: , , - Upbringing, Inlightening, Education -> - _.
17.01.2021 - 17:59: , - War, Politics and Science -> - _.
17.01.2021 - 16:46: , , - Upbringing, Inlightening, Education -> - _.
17.01.2021 - 16:00: - Ecology -> - _.
15.01.2021 - 09:03: , - War, Politics and Science -> - _.
15.01.2021 - 09:03: , , - Upbringing, Inlightening, Education -> - _.
Bourabai Research -  XXI Bourabai Research Institution