.


:




:

































 

 

 

 


.




C++ , . , . . , C++, :

..*?::: # ## sizeof

(-) :

) , ( ),

)

)-

)- ( =)

)- static

- , ,

( ):

class monstr{

...

bool operator > (const monstr &M){

if(health>M.health) return true;

return false;

}

};

. .

, , .

, .

 

void f(Monster x);

void g(const Monster& x);

...

Monster barmaley;

f(barmaley); // barmaley, - .

g(barmaley); // barmaley. K .

 

8 . .

for (int i = 0; i < 10; i ++)

{

double& x = a[i];

if (x > 1)

x = 1;

if (x < 0)

x = 0;

x = x * x;

}

, , , , . - . - , . , , ++ , ::operator++(T) - ..::operator++(T&)

operator[] lvalue, T& Arr::operator[](int index);

 

. .

. ; . - .

:

Array::Array(const Array&)

 





:


: 2015-10-01; !; : 419 |


:

:

, .
==> ...

1541 - | 1443 -


© 2015-2024 lektsii.org - -

: 0.007 .