4.5.
. ( ).
,
.
, .
.
:
- ,
, ,
.
-
.
.
-
;
- .
-
.
.
, , .
,
, . ,
;
.
, ANSI C .
,
.
- FORTRAN 32 .
,
.
; -
- .
,
.
:
1.
.
2.
- , .
- .
. ,
, void.
, fork()
// equivalent
declarations
int fork();
int fork( void );
,
.
( 5.3,
-).
.
.
. ,
min( int v1, v2
); // error
min( int v1, int v2 ); // ok
.
.
. ,
. ,
print( int *array,
int size );
. , .
...
, .
.
.
,
. :
foo(
arg_list, ... );
foo( ... );
, ,
.
printf()
,
. printf() .
,
. , %,
. ,
printf( "hello, worldn"
);
. ,
printf( "hello,
%sn", userName );
. % ,
, s , . printf()
++
printf( const char* ...
);
printf()
char*.
.
void
f();
void f( ... );
f() ,
;
- .
f( someValue );
f( cnt, a, b, c );
. f();
.
,
, .
.
UNIX, ,
, ,
- .
, UNIX
.
. ,
,
char * screenInit( int height = 42, int width =
80,
char background = );
,
.
; .
screnInit()
char *cursor;
// equivalent to
screenInit(24, 80,cursor = screenInit());
// equivalent to screenInit(66,
80, cursor = screenInit( 66 ));
// equivalent to screenInit(66, 256,
cursor = screenInit( 66, 256));
cursor = screenInit( 66, 256,
#);
, background
height width.
.
, ,
- .
screenInit() (
) , height , -
.
.
-
.
.
.
. ,
ff( int = 0 ); // in ff.h
#include "ff.h";
ff( int i = 0 ); {
... } // error
,
, ,
.
-
.
chmod() UNIX .
stdlib.h.
chmod( char *filePath, int protMode );
protMode , filePath
.
read-only. chmod()
#include
<stdlib.h>
chmod( char *filePath, int protMode = 0444 );
,
ff( int a, int b
= 0, int c ); // ff.h
ff()
, b ? -
#include
"ff.h"
ff( int a, int b = 0, int c); // ok
ff() b - .
, ,
, - , .
, ff()
#include
"ff.h"
ff( int a, int b = 0, int c);
// ok
ff( int a = 0, int b, int
c);
// ok