.


:




:

































 

 

 

 





return ;

. .

return .

 

: return;

return 5;

return (5+x); //

 

 

 

++ . (call-by-value) , , . (call-by-reference) , . . . , .

 

:

 

/

void swap (int i, int j) swap(a, b);

{int t = i; i = j; j = t;} a b

void swap (int *i, int *j) swap(&a, &b);

{int t = *i; *i = *j; *j = t;} a b

void swap (int &i, int &j) swap(a, b);

{int t = i; i = j; j = t;} a b

 

 

 

, :

(___);

.

 

: void swap(int&, int&);

int my_function(int p);

 

 

 

(default argument), , , . , .

 

:

int my_function (int i, int j = 2, int k = 3)

{ return i + j + k;} // j = 2, k = 3

y = my_function (1); // : 1 + 2 + 3

y = my_function (10, 20, 30); // : 10 + 20 + 30

 

 

 

inline. :

inline float cube(float x) //

{return x*x*x;} //

 

 

(overloading) , :

float cube(float x) // y = cube(1.5);

{ - - - - - }

int cube(int x) // z = cube(15);

{ - - - - - }

 

 

 

, . : , , . : auto, register, extern, static.

(scope) , , . ( ), . .

 

, , :

1) ;

2) , , Void.

3) .

( ):

 

                   
e 0,01 0,001 0,0001 0,001 0,01 0,001 0,0001 0,001 0,0001 0,001
X min -2π     -2π π    
X max π 3π/2   π/2 π
Δ x Π/4 π/12 π/6 π/12 π/12 π/4 π/6 π/8 π/4 π/3

 

 

 

. n .

 

, , | h | ≤ ε.

Switch.

 

1. , , , .

2. ? ?

3. ? ?

4. , ?

5. ?

6. ?

7. .

 

 

II

 

: , ; ; , , .

 





:


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


:

:

- , , .
==> ...

1356 - | 1188 -


© 2015-2024 lektsii.org - -

: 0.013 .