.


:




:

































 

 

 

 


(new, delete).




. , .

new [2]:

= new _

, , . , , . new . ( ), new (NULL). . , _ new.

.

delete

.

, delete, , new, .

23. ++.

new :

int *mas1; //

mas1=new int[n];

float *mas2; //

mas2 = new float [n*n];

, - .

24. ++.

25. , p pp ++.

++ . , [2]. , , . . , , , . () , , , , . , , , , , .

:

<> <> ([< >])

<> - , ;

<> - ;

< > - , , . . . ( ). , , , .

:

< >(< >);

, , . , .

26. , , ++.

27. ++.

1 , 0 255 128 127. , . .

-. getchar () , , . putchar() , , .

, string.h.

 

28. pp ++.

- , , . () . , . , , . . "" -, , :

( );

( );

( ).

:

struct < >{

< . >

};

struct ; < > ; < . > , , .

, union [11]. :

union < >{

< . >

};

 

< > ; < . > , , .

29. ++.

. . , ( 1 16). , , . . . , . - . – - . , , .

 

:

struct <>{

< > 1: ;

< > 2: ;

< > N: ;

}

 

, (). , :

struct w{

int a:9;

int:7;

int b:9;

};

30. ++.

- char. . , .

, - , :

in=fopen("input.dat","rb");

 

fseek:

fseek (in, offset, wherefrom)

 

in - ; offset - long, , ; wherefrom , , . :

#define SEEK_SET 0

#define SEEK_CUR 1

#define SEEK_END 2

 

0 - .

1 - .

2 - .

31. . ++.

. , . , . , .

 

++ :

(auto)

(extern)

(static)

(register)

 

, . , .

32. ++.

. ’\n’. . , . ( ) ( ) . - . . . , , , (. . , , , IBM)

33. ++.

argc argv, . , ++. argc int , . argv char *[] , . -. , .

34. ++.

35. ++.

++ . , - . , , . , . .

36. ++.

. , . , . , , , [4]. , . .

template. , <>. class, (),

:

template <class type>

, , . type . .

37. ++.

inline , . inline- . , . :

inline int FCUBE(int x)

{

return x*x*x;

}

b = FCUBE(a);

c = FCUBE(a++);

inline- if, for, case, switch, while.

inline-, , , () , . , . , .

38. ++.

++ p pp p . , , [7]. , .

, drawcircle, , :

void drawircle(int x = 100, int y = 100, int r = 100)

void drawircle(int = 100, int = 100, int = 100).

:

drawcircle(); // (100, 100), 100

drawcircle(200); // (200, 100), 100

drawcircle(200, 300); // (200, 300), 100

drawcircle(200, 300, 200); // (200, 300), 200

drawcircle(,, 50); //





:


: 2017-02-11; !; : 503 |


:

:

,
==> ...

964 - | 875 -


© 2015-2024 lektsii.org - -

: 0.045 .