4.4.
,
(
).
double sqrt( double
);
char strcpy( char, const char* );
IntArray &Intarray
qsort();
TreeNode *TreeNode inOrder();
void error(const char* ...
);
,
.
, , .
, , void.
, ,
int.
isEqual()
;
int
int isEqual( long*, long* );
isEqual( long*, long*
);
return .
,
- .
return
return;
return expression;
, ANSI
++ ANSI .
return , void.
. (
return
break ). return
. ,
void dCopy( double *scr,
double *dst, int sz ) {
// copy scr array into dst
// simplifying
assumption arrays are same size
if ( scr == 0 || dst == 0 ) // if either
array is empty, quit
return;
if ( scr == dst ) // no need
copy
return;
if( sz <= 0 ) // nothing to copy
return;
// still
here@ copy.
for ( int i = 0; i < sz; ++i )
dst[ i ] = scr[ i ];
//
no explicit return necessary
}
return
. ;
. factorial(),
, return
return val * factorial( val-1
);
, ,
, . ,
,
void, . ,
. main() ,
return.
. ,
enum Boolean { FALSE, TRUE };
Boolean isEqual (
char *s1, char *s2 ) {
// if either are null, not equla
if ( s1 == 0
|| s2 == 0 ) return FALSE; // if s1 == s2, return
// TRUE; else
FALSE
if ( s1 == s2 ) // the same string
return TRUE;
while ( *s1
== *s2++ )
if (*s1++ == � ) return TRUE;
// still here not
equal
return FALSE;
}
.
:
-
, .
. ,
.
. , ,
,
. ,
.
.
-
, .
- . ,
; ,
.
-
.
, . (
4.6 - ).