. .
● - .
● - , .
, .
. -, . , , .
, , . , 10-15 .
-
, . , .
, . , .
, - . .. , , .
- , , .
-. , - .
3 :
●
●
● , .
( ) . , .
|
|
, , , .
. , , , .
, , , .
. #include . . . , , ::
, (LIB) (DLL) . , . , API .
. , , - . , .
, , . , . ++ , .
, , -, . , , , -, . , , , .
- .
|
|
, , - , -, , . .
, , .
, - , . . . , - -. , . ->.
++ , -, . - , .
.., - , , , .
, , , , - () , . .
. - -. . this. -.
++ - , , . - , . . , , .
, , , , . . ( , ). , . . - .
class X | |
{ int i; | |
int i; | // |
}; | |
int X::k; | // |
class Y | |
{ int f(); | |
int f(); | // |
int f(int x); | // |
}; | |
class Z | |
{ int f(); | |
int f; | // |
}; |
. auto, extern register. . , .
( ) :
<>. < >
<> -> < >
, friend, - . - . , - .
|
|
- this , , .. - x, this -> x. , , .
class X { private: int n; public: | |
void f(int n) { this -> n = n; } }; | // n n |
this - X * const. , , -. - this const X * const .
this . , this .
- this , .
class X {... public: X& f(); }; X& X::f() {... return *this; } |
const. , , . const , .
class X { private: int n; public: int f() const; }; int X::f() const | |
{ return n++; } | // |
- , , , .