.


:




:

































 

 

 

 


typedef, struct




.

, . :

union { 1;... n; };

, , .. . , , .

, . , .

:

- , ;

- , .

, , , . , . , .

:

union { char fio[30]; char adres[80]; int vozrast; int telephone; } inform; union { int ax; char al[2]; }ua;

inform union , .. inform.fio, . ua ua.al[0] ua.al[1] ua.ax.

, . . . :

struct { unsigned 1: - 1; unsigned 2: - 2; }

. , . .

:

struct { unsigned a1: 1; unsigned a2: 2; unsigned a3: 5; unsigned a4: 2; } prim;

. , .

, . , .

:

1. .

2. , .

3. .

4. .

5. .

6. .

7. .

8. .

9. .

10. .

11. .

12. .

:

1. :

, . .

.

.

.

2. . :

sum(a, b, c), a b. ;

min(a, b), . .

3. time , , . :

next(t, t1, d), t1 d , t. .

fun(t1, t2, d), d, t1 t2.

4. , . , :

;

.

8

:

(4 )

. /, .

( , ), FILE ( stdio.h). FILE , , .

FILE; , , fopen.

, / . . , , fopen, fdopen freopen. , , , , . , . / DOS.

.

DOS, , . / , , ( ASCI- ). DOS, , ASCII- . / (CR/LF) ; CR/LF .

, . . .

, .

#include <stdio.h>

FILE *fp;

:

fp=fopen(*_, *_);

:

if ((fp = fopen(* _, * )) = = NULL){

fprintf(stderr, "Cannot open input file.\n");

exit(1); }

, , : w, r, a, w+, r+, a+, b, t.

, , NULL.

, , ( ).

. int fclose (FILE *fp);

, fclose().

:

fgetc(), fputc(), fprintf(), fscanf(), fgets(), fputs(), fseek(), ftell(), fwrite().

:

1. .

2. .

3. .

4. .

5. fgetc(), fputc(), fprintf(), fscanf(), fgets(), fputs(), fseek(), ftell(), fwrite().

:

1. . . +, , .

2. :

) n- fseek();

) n , n;

n . n .

3. .

4. .

9

:

(4 )

(pixels, picture elements), . () , , .

, , :

; DOS BIOS, ;

, .

(CGA, EGA, Hercules .), , .

GRAPHICS.LIB. , , graphics.h, #include. graphics.h , , () .

80 . :

- ;

- ;

- ;

- ;

- ;

- ;

- .





:


: 2016-03-28; !; : 634 |


:

:

, ,
==> ...

1445 - | 1407 -


© 2015-2024 lektsii.org - -

: 0.076 .