.


:




:

































 

 

 

 


. - -. . this. -




. .

 

- .

 

- , .

 

, .

. -, . , , .

, , . , 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++; } //

 

- , , , .

 

 





:


: 2016-07-29; !; : 882 |


:

:

: , .
==> ...

2217 - | 1834 -


© 2015-2024 lektsii.org - -

: 0.014 .