|
函数大全(c开头)4 _# p6 B& A: W; S5 X+ h
$ H8 i0 X7 F7 S函数名: cabs
& H* y- g# X7 y A' M0 [功 能: 计算复数的绝对值
8 a+ W- p9 ]8 h1 x% c+ \用 法: double cabs(struct complex z);
& V1 [' {3 o- ^9 c' ?9 v程序例: & f0 a' [2 B1 l0 q' W5 \0 K) j1 t1 f
#include 9 X+ u9 j i: @$ h! Q
#include ; @4 w- z8 y! \$ H) D9 s
int main(void)
" y1 p; c) S; M8 g' Q% ]{
( ~1 I! q+ m5 r3 y: d' j2 G$ E" ostruct complex z;
6 ?- l, T5 z. ?2 bdouble val; 9 O2 L: e# R4 f2 f0 Y5 T" U
z.x = 2.0; * E. t( l M5 M% D
z.y = 1.0;
% M+ @) w- u4 oval = cabs(z);
. i9 c+ `: a( J' E: `printf("The absolute value of %.2lfi %.2lfj is %.2lf", z.x, z.y, val); " |& Q4 _9 W' L2 A
return 0; ( N4 G `7 U. \3 b: L0 Q( o
} 9 d/ o" f" a8 J5 l5 h& @
: @3 e) @. S; @1 ~7 ]# f7 R
' G" A: z2 n. ?& Q# [ 5 H! g3 p) W) O0 \3 A! H0 c/ D3 C/ V7 J
函数名: calloc
( T" J% w m0 P( Q功 能: 分配主存储器 - B3 z1 z& G1 o3 P
用 法: void *calloc(size_t nelem, size_t elsize);
7 f$ U6 }* G( ?, t- H# w程序例: ( \4 X2 x# t" A) x- h( f. k
#include
% ]7 n8 }( A/ |0 W2 F( }' S4 D4 h#include
/ u; A8 k2 v7 R- t: Q4 nint main(void)
$ H( o# d! B& e{ & ^* ^0 M% b% U! t* [( e' M! H
char *str = NULL; . m! O; F0 I. N9 J
/* allocate memory for string */
6 R7 x7 x9 P8 |5 m! n* J& Ostr = calloc(10, sizeof(char));
: v; c( J5 {+ O% ]5 y4 ~" o y. D4 @/* copy "Hello" into string */
" F Y/ U- K" H& b r, Nstrcpy(str, "Hello");
0 l' c, u- |. h, w( `; c6 O% B8 e/* display string */
/ s( B, N1 M6 R7 f/ Q: `printf("String is %s\n", str);
: U- X; Z. d6 U8 Q1 h7 H; g/* free memory */
( m$ ~4 U6 {% R: Mfree(str);
9 g" B: x$ k3 vreturn 0; ~6 g+ w6 I3 B+ x
}
* B: U/ X% ~3 D8 c' M' n- H' J( }" p0 G, e! O
% D# B. m% _7 I% R* e* |
4 J3 l1 c! I6 Y4 B函数名: ceil ; x _, A/ U F& B( T3 T. y
功 能: 向上舍入
% w8 ~6 c& C1 @用 法: double ceil(double x); / z( Q. e% |' {# p4 S' h
程序例:
8 h3 A, \7 ?2 E5 d9 d0 I#include
' E5 {0 ^4 U8 t#include
5 m5 m- s& h# K+ y& z% hint main(void)
% g) O' n' }6 X" G* Z, ^3 H{
* F' H! g( i7 zdouble number = 123.54;
) `% D( m( \2 d5 s! Q4 R! ]double down, up;
/ e! {6 Y- M# p, _7 B* Edown = floor(number);
1 z0 I; X" u6 r8 yup = ceil(number);
+ S6 W% I$ F! t; tprintf("original number %5.2lf\n", number);
4 y3 F, `& S. B1 c Dprintf("number rounded down %5.2lf\n", down); , M3 R! W. z7 t( x$ _0 U7 |* R
printf("number rounded up %5.2lf\n", up); 6 @+ B+ A: D# l! \5 Z
return 0;
6 I" `) o' {# b. C- U( b}
/ L, ?* e8 e" [
$ b* m& S8 n+ F. h5 n# L+ }# \8 |3 D8 H' y
: f8 s9 G9 i' y2 }7 A% E& c
函数名: cgets
* Z9 D8 n1 C: l9 q! N0 K功 能: 从控制台读字符串
5 q) H* w8 o4 u1 w9 \, z, d用 法: char *cgets(char *str); ! x0 ?- `! w$ x7 n( ~, q; ~
程序例: 1 ]# b8 Q# v' |! R, }) m
#include 8 E! z& K+ ~8 v" _2 I9 d% Z
#include
$ r( n4 U- S- ?1 G. xint main(void) / h: f+ o( r7 I$ E+ _7 X( K; l( |# J
{
K8 Q) Z8 ?, t2 h$ A/ [+ [, Xchar buffer[83];
. m( q$ {2 z& e2 a) A! W! |) Schar *p;
6 X& a* J- B( v/* There's space for 80 characters plus the NULL terminator */
% @' G3 `8 z7 y: }6 N; @8 t; Wbuffer[0] = 81;
' ^" N4 L* |# hprintf("Input some chars:");
4 L8 p7 e4 q0 K9 V+ Fp = cgets(buffer);
" S9 L9 `: f. b; K: G& _1 Xprintf("\ncgets read %d characters: \"%s\"\n", buffer[1], p); ( t% `8 ~* K2 G5 V! B, H: |1 Z
printf("The returned pointer is %p, buffer[0] is at %p\n", p, &buffer);
, S4 G7 ^+ _3 B7 }! n. ` S% I/* Leave room for 5 characters plus the NULL terminator */ ) j- M l, R" D0 Z' Q3 W
buffer[0] = 6;
$ g5 u0 n- W; i) Y5 u/ E4 w$ tprintf("Input some chars:");
, | G+ q. `- Ep = cgets(buffer); ! B1 U+ p0 ?( I' i' f0 L2 W1 t' z
printf("\ncgets read %d characters: \"%s\"\n", buffer[1], p);
- ]3 B; ^/ R; iprintf("The returned pointer is %p, buffer[0] is at %p\n", p, &buffer); - V3 b+ ^* T7 E: I# F! L
return 0; 6 s/ Q$ w) }6 t( C3 P
} + ]" c( m5 M5 b
* \* ~: A6 ^' R$ `0 u. y* B7 \- v2 z4 K' o8 Y3 v6 q
_5 @3 ^4 z7 j R函数名: chdir
/ l4 G* q U+ j6 A0 [0 n功 能: 改变工作目录
+ ?- a0 v4 t" Z, U( J5 w用 法: int chdir(const char *path); ; [& y9 @; p% C0 ?8 n1 s
程序例:
" q/ u1 e8 @- c& H9 v#include % E# V8 N+ z n0 h) u2 F2 b+ E. s
#include
2 ^$ M3 F5 F a) ~. v* ?) @) {: U#include
$ s2 {% Y- z9 F+ fchar old_dir[MAXDIR];
; n/ ^6 \& V7 ^3 X1 |2 z7 Ochar new_dir[MAXDIR];
* U/ |; O) N0 M' d( iint main(void)
/ |, G x1 v. j9 A{ % i, S. u- p! V" ?9 ]2 O8 l* b- E' r& l
if (getcurdir(0, old_dir)) 8 a8 b* y- ? Q8 ^* Z
{ 3 {1 X- u; ~6 N1 e4 R- I5 B4 C5 Z
perror("getcurdir()");
+ `. @7 G8 n1 r, o; O+ d2 ^1 @1 [. mexit(1); $ M5 a6 X$ A k/ O3 t4 `
} ' c0 n8 C) n9 ]
printf("Current directory is: \\%s\n", old_dir);
( v5 [2 [' |5 }) t. h, Z! @if (chdir("\\")) - Q# w2 P1 X' ]$ L! v' R% Y
{ # B# N. @, q$ `( _' S( Q
perror("chdir()");
* C( X; O* P" X5 l+ \exit(1);
- o2 D2 }, B1 N}
8 [4 }8 [% c ^. p4 |6 Iif (getcurdir(0, new_dir)) , ?& N" N! ?' [2 i. g; s9 A
{
2 y! c7 B& H; F: D: ~) ~' Xperror("getcurdir()");
+ A: q3 [& [ H2 |exit(1);
$ M5 k+ k8 ?) w8 N$ t$ Y3 [}
8 M% ^& p+ d& y) N+ jprintf("Current directory is now: \\%s\n", new_dir); / u4 q( s% o) g) X9 {
printf("\nChanging back to orignal directory: \\%s\n", old_dir); # G5 u F. e" u, o8 p
if (chdir(old_dir))
7 \1 Z1 |* ^7 i/ d" t: z9 {{ 0 [9 c) c% V" [# `2 ]' E$ Y) n! K
perror("chdir()");
3 H1 M* B' ^! s# L @" |. c# C) ]exit(1); 8 D2 Y- o$ D; h6 e4 j) U/ |
} : w' [$ e( j9 z2 e2 c
return 0;
0 ~/ N& U9 d1 Z8 C2 y+ Y& r}
4 I, u2 Q" @% f1 c8 V6 M9 ]
6 W( k% d, b% U$ u, j $ a4 x0 h6 Z0 r( r+ I4 J1 u- j
函数名: _chmod, chmod
- D) f, P- L7 g7 @7 L9 o3 g; @功 能: 改变文件的访问方式 3 b X9 Y* u# E8 b3 E& U
用 法: int chmod(const char *filename, int permiss); 9 p/ x) K3 {3 l- M% [
程序例: - p/ K1 i; J- R; o, ?$ v; c
#include
+ U. g! k1 V* r _#include ' H+ q0 X n+ K" j% [# h9 g
#include / ?) o9 h% ^" x0 K5 B
void make_read_only(char *filename); 7 t5 Z% x( L0 q+ a+ G& N% C6 P F
int main(void) 4 q6 F1 E; H3 Y) A% W
{
2 M+ u. X; Z, K- amake_read_only("NOTEXIST.FIL");
- ^' x+ l) e/ a, U, w, r! ^# {make_read_only("MYFILE.FIL"); + L4 `: s8 T0 x2 R+ T* [
return 0;
; n1 B- H- s! E' D0 E& G: {} ! g4 W# U% C1 H/ A: x# J+ n
void make_read_only(char *filename)
/ n$ F4 i* _# d- E" E{
. e' l# O8 m3 r5 g; z. j3 @ _2 aint stat; 7 R6 l5 a+ @+ A, ^
stat = chmod(filename, S_IREAD);
2 ~- |: o2 D0 {if (stat)
. o9 Q1 v& j. o3 hprintf("Couldn't make %s read-only\n", filename);
" i: `2 s% j5 J; |1 N4 L4 Welse 5 v. h! _3 s0 P' \+ t
printf("Made %s read-only\n", filename); 8 J, ^ V: O6 `& ~8 y: _+ B
} 1 ^0 z' D$ j( V) m
& w; V+ H; ^% X. u* y. P y: K" H+ K3 t. O
1 e4 a, n/ B$ u, s, ~/ O
函数名: chsize
! z9 R( Z- J' f+ T$ Z+ r) x功 能: 改变文件大小
$ r# f$ L7 w: y! I2 s9 j4 w$ H用 法: int chsize(int handle, long size);
; f' V2 `- j9 n$ U* Y程序例:
; ^7 b; h0 m: o" j#include
' q- F7 t# Y/ {. \) H) B* q#include 9 K5 @8 |2 O- K$ N
#include
- I" k, E$ ^9 ^. Oint main(void)
) d2 W% P+ n3 m: b- w{
; Z# D9 W, Y, r2 o; aint handle;
. M2 i5 @! w" E$ e, b: lchar buf[11] = "0123456789"; 7 {, T/ N4 ]/ g0 u, F, |& Q
/* create text file containing 10 bytes */
1 m8 \$ q3 H, I" Lhandle = open("DUMMY.FIL", O_CREAT);
( L. D) S' x) U) F. |' h1 Iwrite(handle, buf, strlen(buf)); 2 p3 a$ d% q6 k* S
/* truncate the file to 5 bytes in size */ $ K: F8 R& L( V) a) ?% m
chsize(handle, 5);
* j. D1 B5 |/ l! x2 m x/* close the file */ / B% r3 w, P+ l- L0 B; N
close(handle); 2 H1 ~, E$ a! x/ j |7 q1 ]
return 0;
( K- t0 j5 Z% y1 S' z. I}
. \, _; C4 ^5 }9 [, v5 h" |+ H) M% H/ S# I( e( x0 }3 l
0 C# J& R7 d* H7 e7 L1 ~+ u函数名: circle
7 R% f6 Y9 X/ r+ Q6 t功 能: 在给定半径以(x, y)为圆心画圆 , _& |6 A# d" b. X
用 法: void far circle(int x, int y, int radius);
$ U6 x; l) \. h" |$ Q0 n; w1 K9 ~程序例: % R1 i" o8 A, |# d
#include
% t7 H" i8 l0 F/ K o#include ' G: a' a4 O0 Q* X3 K3 Z; d# I6 N
#include 0 g' R7 i- ~1 n. w* J
#include
B) h4 x2 M: Xint main(void) / B4 U" D5 G( Z# G3 P8 m& O3 h
{ $ k/ J' C. j& m: H( `: [
/* request auto detection */ 5 W& O# V! \- p
int gdriver = DETECT, gmode, errorcode;
" e. e* m7 R( u0 E0 H/ q) Eint midx, midy; * K4 C1 {8 R% m8 y$ N
int radius = 100;
) N1 K8 e! @4 S* r. L. h/* initialize graphics and local variables */
0 F; }, m$ b7 v7 ?; o7 E- \initgraph(&gdriver, &gmode, "");
5 W2 ~! E S% g6 v/* read result of initialization */ , |' X; R! p1 s8 T R7 K6 H# W
errorcode = graphresult(); + M% _; J1 K% E6 j
if (errorcode != grOk) /* an error occurred */
; n' u$ S" L4 e{ H) B/ f1 z* P9 u: h$ w l5 I
printf("Graphics error: %s\n", grapherrormsg(errorcode));
( ]6 R9 t# S: A1 `7 ~printf("Press any key to halt:"); - W, f' r1 i- y. {7 f) {
getch();
3 z, u; H7 L% t3 m! m1 Jexit(1); /* terminate with an error code */
5 r! z4 }1 E O. p}
3 O" y% d& c; _3 ?8 k8 tmidx = getmaxx() / 2;
, ^0 N# l2 R7 U2 L/ y3 tmidy = getmaxy() / 2;
8 a$ x0 {! N) B0 u0 D' ^setcolor(getmaxcolor()); # l# @- D3 v! d) Z6 H O) j
/* draw the circle */
: s! F8 |8 _! qcircle(midx, midy, radius); ' d' H" B8 D! ~
/* clean up */
# t4 t. _. s: t. @/ _* Z) lgetch(); Z7 [9 W$ N5 e6 w
closegraph();
# y$ ]9 z+ L Z' a. l- u8 {return 0; 7 F! |* s( }- j6 H5 X& z2 J
}
" q) y g( O$ `, A# F; M/ A6 R8 Y1 {. J' @# X) u7 ^/ Q5 `' \
3 B2 w3 d/ i9 }; w ' u" P' [/ A2 {# ?0 _
函数名: cleardevice ' j# x- Q9 ^; b' w; F9 r* r) H8 y
功 能: 清除图形屏幕
9 l+ m ?0 ]0 \$ L$ T( m6 p' o用 法: void far cleardevice(void);
, K( r6 |. w% E5 B/ t9 t: o5 z程序例:
! }. S' I: Y- c4 y- d6 M#include
0 R- j( P; Y$ ~9 O/ {. v#include 0 ^1 n# K) ^; `8 W- a9 e
#include 8 k. e( _0 ~, G) [+ X
#include
% W/ p; Y& Z, P; h! G7 y/ g# X8 ?int main(void)
. j! j7 @; n p1 z{ + k* R9 l6 _7 `% ]9 h
/* request auto detection */
- K* p6 S1 s3 Dint gdriver = DETECT, gmode, errorcode;
4 x, i9 L8 x3 y. Jint midx, midy;
& ]5 \5 A1 @! Y$ }! S/* initialize graphics and local variables */
% c/ r1 \3 R8 L1 G/ jinitgraph(&gdriver, &gmode, ""); - w7 c s2 \- z* q
/* read result of initialization */
7 {5 ]# c: ^2 f4 derrorcode = graphresult(); : N+ l+ a/ U7 X/ K' S3 `
if (errorcode != grOk) /* an error occurred */
) [! }/ g0 u- T' ?) r7 l8 P0 E: E1 D{
( [# v+ a+ |3 h/ P' a( {printf("Graphics error: %s\n", grapherrormsg(errorcode)); + s4 a3 D: x) j3 Q
printf("Press any key to halt:"); 0 O) F: j' s% P* [+ [' w9 h
getch(); 4 ^5 W8 ^! M" t- l1 {2 ~' i; v
exit(1); /* terminate with an error code */
: z8 K. r, R M3 f1 Z# B} # E$ O5 w: Q% ^+ {( P& g
midx = getmaxx() / 2;
4 E6 ~' u' u* T, u% amidy = getmaxy() / 2;
' M: S1 E: R% A \! l: d4 hsetcolor(getmaxcolor());
, y+ r( [; `) q8 v# p7 \2 J/* for centering screen messages */ . f/ ^6 g; X. e, f' K, W
settextjustify(CENTER_TEXT, CENTER_TEXT); ) I! T' M3 x; `' p4 l2 Q+ x/ j
/* output a message to the screen */ 9 b: w. d+ Z. I2 m: }
outtextxy(midx, midy, "press any key to clear the screen:"); , ^+ x j) t' ?+ g
/* wait for a key */
* A; `! w: b) G! x' E" G& Tgetch(); 9 I# P) c: \) d* L& M
/* clear the screen */
, w( I( i! h# t. Rcleardevice(); . ~( o) w7 f1 z8 q; d) ?: u, [
/* output another message */ o0 n `$ b: A0 x2 L
outtextxy(midx, midy, "press any key to quit:");
: F6 X( S3 m& x- h& o/* clean up */ # k( m, r* Z% @% e0 L! a$ Z
getch();
4 F; Z, {+ S) h9 _: Jclosegraph();
, ?: t2 h" z% A+ l0 H: Freturn 0; ; f- `# Y& {8 d/ [1 Q
}
$ h) J$ s5 b e9 h* m5 a7 R! k; b, |' K( X. |) n0 {: U
* n) |7 A/ e. H7 ?& I% [
, r( N8 J2 [3 R, X4 ~/ n* ~: i. O函数名: clearerr $ h Y9 y; O$ k3 g o. e
功 能: 复位错误标志
0 H* d( P" a! h用 法:void clearerr(FILE *stream);
. I8 U( o7 K, ]程序例: 8 P$ V; N O+ C% k# ?( g
#include 0 f5 I) ^4 l$ o: P) m$ h5 O, ~
int main(void) 1 v! w# E9 W; W0 F
{ ( | ~: T/ B( q9 _7 c+ n1 q7 Z) Q4 A
FILE *fp;
- H u9 G5 y8 m6 D/ nchar ch; : |6 D& d$ \+ d
/* open a file for writing */ 1 h2 M \9 J1 Y: H6 Q4 S5 G
fp = fopen("DUMMY.FIL", "w");
5 `+ ~2 Y- P3 N& q1 p) _0 B5 Y/* force an error condition by attempting to read */
3 X4 z* [! o, U! A0 K& l8 e/ cch = fgetc(fp); 1 f! w: d$ K4 ^# V. A+ Z
printf("%c\n",ch);
0 s" a+ r9 R6 R+ @9 a3 Eif (ferror(fp)) 0 a! _, O+ R/ V: l, ^
{
& G2 C6 s5 U/ B% F0 t _# r/* display an error message */ * I5 Z) i3 _7 a6 b. P* l) ]- U
printf("Error reading from DUMMY.FIL\n");
% Y4 m6 w+ @8 W) d1 m/* reset the error and EOF indicators */ ! R6 [! @/ b/ c1 ]0 ^) t; W i
clearerr(fp); 6 \9 _' i# Q" Y# V' ~ r p x* N
}
$ P8 s J/ b6 I4 Q* {fclose(fp); * {2 C2 t5 e5 G1 b5 P0 M) m, e1 R9 x
return 0;
8 S+ ?4 o; m; H& M+ t}
8 ~5 o4 e0 {9 G+ \/ n( _
' b9 M; V% F' J7 e9 w6 b* E& ~. M8 E- e: y
5 b0 A$ ^+ J: g1 \函数名: clearviewport 3 n! E( j6 z7 \* O5 h. K
功 能: 清除图形视区 6 ]4 ~1 O( |7 R v1 u4 c& P
用 法: void far clearviewport(void);
& c7 {9 U5 x, }程序例: ) W+ I, u( H; P" {8 V: J4 ?
#include 1 }$ u' U+ C+ ^! Y$ g6 J" s7 T. b
#include ' v3 v* F; @7 E, o6 [: u6 i
#include
8 N: y& ]' [! |& l! k. |7 m#include 5 S4 u! [' W+ Q
#define CLIP_ON 1 /* activates clipping in viewport */ % j, k3 Z5 Q# D9 ^& i1 k
int main(void) ~- o8 h3 R( F# U* G
{ Y& x; _% G% |& X+ R! Y
/* request auto detection */ : _5 r, }" u, H
int gdriver = DETECT, gmode, errorcode; , _' J0 L0 w5 O3 _4 h
int ht;
$ r, l6 |6 h5 x' G/* initialize graphics and local variables */
4 j2 _0 u$ ^1 b. o" ^# dinitgraph(&gdriver, &gmode, "");
6 a2 O2 G* {) P4 S/* read result of initialization */
+ q7 O0 m* Y" n6 jerrorcode = graphresult();
) L8 W* z( F- o6 l0 H/ e7 m5 Z$ Jif (errorcode != grOk) /* an error occurred */ k: O8 d/ m+ V8 [, h$ s
{
/ t" O5 A, Y# {9 e$ tprintf("Graphics error: %s\n", grapherrormsg(errorcode)); 9 s/ P' Q% g" C% M" p
printf("Press any key to halt:");
' V/ ^& d4 k% x/ O$ [: k$ ugetch();
# f. z! l! d5 B j# _4 O! F$ I( A+ nexit(1); /* terminate with an error code */ 2 J5 x7 W i3 {# H; \7 k' M
}
4 R* ~- w' c( Z7 ]- x( Zsetcolor(getmaxcolor()); 4 v& ^; K( R" L
ht = textheight("W"); 4 D. J6 h, R* l N, U' m# Q; j
/* message in default full-screen viewport */
! P1 N- K2 O* b, Q* s" W+ X, uouttextxy(0, 0, "* <-- (0, 0) in default viewport");
" L. r. ^8 f4 o4 q1 d/* create a smaller viewport */
; O/ s/ K% g- Q/ ]. Osetviewport(50, 50, getmaxx()-50, getmaxy()-50, CLIP_ON); 5 Q4 b; y$ W7 |7 I& Q5 w& V1 v/ J8 a( R
/* display some messages */ ! V2 p) q* s, b
outtextxy(0, 0, "* <-- (0, 0) in smaller viewport"); + f0 z6 D9 D% A, Y
outtextxy(0, 2*ht, "Press any key to clear viewport:"); 1 R' l. ^( C2 p: i" q
/* wait for a key */
) w; M! S P3 v: F3 e8 p- wgetch();
* G* x( X. u# r/ A; @; b- b/* clear the viewport */
9 @* o/ \) u0 X* t- |clearviewport();
( s T0 d* o9 z2 k2 a/* output another message */ 7 [1 B1 \9 H; y0 f* d
outtextxy(0, 0, "Press any key to quit:"); " x4 a) G* L: P$ a. {2 @
/* clean up */
0 o" i; P, X3 J. b1 }getch();
8 N; B4 l( p- W, v4 A7 Oclosegraph(); 9 ?: l2 T( P4 p% j5 R# i6 z% M u. n
return 0; ! s- K, ]( x# J6 M+ Y
}
/ _3 O: T% Q. g4 v! {3 C( p( J0 o- i( E0 C* H
& M# G$ d9 h! r: F" S: s' I7 p$ K7 r
) t L7 {, Y2 N# |* ^$ |3 K7 ]( x函数名: _close, close
9 j) y7 y9 q/ L: t8 F! y9 d功 能: 关闭文件句柄
( j8 Y3 k( K) q. d用 法: int close(int handle);
" b8 B8 b; @/ C' q. |1 N程序例:
* v: s* M3 i6 T2 c6 [) I#include
) R; G( g: |1 }, g5 I3 h#include
6 p8 I5 H$ c9 i7 |3 ?#include 0 H) J- {% D. `% Z2 k9 \
#include
: M8 H7 n- Z& ~main()
! f1 V; n; G& `7 P% E! D' Y/ I{ 1 [3 |. X' ~- U4 ]- @/ Z& B* O
int handle;
, B3 ~# y* q/ G: n% d2 O3 ychar buf[11] = "0123456789";
) p4 _9 K/ D# S3 j/ O/ {/* create a file containing 10 bytes */
) h+ w( Z, S) a# p1 ~2 Phandle = open("NEW.FIL", O_CREAT); : ?: ] S2 R. P
if (handle > -1) + N( a9 |% B5 c; T( G, q
{ 7 ]6 k, |0 v# K5 e
write(handle, buf, strlen(buf));
/ I; N. p! R* Q/* close the file */ $ [1 a7 i" _3 l* i5 J) d
close(handle);
5 H4 a# I1 F' j U2 C* R8 j7 J}
1 A, _) ^( ]; D) z' m. G" }& V6 k) Ielse
3 ]% b. w; l6 E) e: i! X( l{ s/ w$ c. U% t5 Y
printf("Error opening file\n");
1 p* i) I( F+ }" p7 d( i. I+ H} 4 p7 s1 D0 m4 C: j) T# c
return 0; $ \% T Z4 Q0 w3 Z- Y0 _
} 2 a2 N3 a1 o, P3 O* }3 Z4 C
) n2 B) F3 q% W+ L8 e5 `
5 _. s: H4 k( j$ u6 [) X$ p% H* p: N; B
8 X( F+ H8 K$ N9 X5 s函数名: clock ( T0 Z; v. x8 E) r, d. \! G, T
功 能: 确定处理器时间
) ?/ s, C" H) N用 法: clock_t clock(void);
, K5 ?6 D. t0 i" i程序例:
/ n: H/ p# v; {6 F8 h#include
1 P6 q/ l* s; o$ X#include ) R3 M& M! e& h
#include
' g' a% K% g/ w4 ?# s" bint main(void)
. E- Q2 x. g7 g d$ {{ - ]$ [' p, Z3 m5 Q$ e2 a: r- r
clock_t start, end;
# c$ x4 J! N8 I+ b! Wstart = clock(); . V: T: N0 c/ g+ `4 Z V
delay(2000); 9 g9 ]1 u0 p- s+ Q! e. Q; I
end = clock();
0 S; N- L+ u% N/ K0 r+ N6 Q+ dprintf("The time was: %f\n", (end - start) / CLK_TCK); ; n. p$ x3 }7 @. J( b' D1 @ y7 ?$ r
return 0; / w, o" y% d' P, _
} ( I, v/ P( }9 M1 T q
6 n1 R7 ]9 ^4 Z0 {4 G% f
+ h; q6 J6 P2 A5 b. Y% w, I
0 `0 R8 N8 N* t' X
函数名: closegraph 6 \$ i- I$ p w( d/ a6 x9 Z
功 能: 关闭图形系统
# O, V( Z7 [" s1 \: I用 法: void far closegraph(void); # t- Q6 h1 {; K& S, W* j" X5 ]
程序例:
7 d+ T" {; n2 v#include 5 S" ^7 c) C7 r$ i1 n2 I
#include 8 e$ m# |$ a' v; N
#include
3 `& R0 R! G9 a4 t' k#include
, P. K+ N) T4 Y4 ?2 L+ zint main(void)
/ K _# u9 ]8 j$ S5 A{ 6 ]$ ?4 @( I1 f" H* r6 E
/* request auto detection */ $ {4 o2 b- Q; @, _9 q
int gdriver = DETECT, gmode, errorcode; ) @( u* C" `5 `! X \
int x, y;
$ j. J2 k) U! ~ u' k9 `. r5 I4 B, m/* initialize graphics mode */ # @4 [- {6 l4 }" c4 G
initgraph(&gdriver, &gmode, "");
5 B F" t2 D/ N/* read result of initialization */ ; E0 y$ s6 f2 K$ x( e) k
errorcode = graphresult();
& E) G$ E! [5 N+ x6 @if (errorcode != grOk) /* an error
& w+ R, @4 `/ \3 ?+ aoccurred */ : Q7 x+ H# S6 n4 u- j5 y
{
% `/ G2 S8 E) F; U0 ?& Zprintf("Graphics error: %s\n", grapherrormsg(errorcode)); # @' {+ q: e3 p6 K! z
printf("Press any key to halt:"); 8 @$ I1 y9 l% a% x
getch();
. @; j2 H* S% B0 Cexit(1); /* terminate with an error code */ 7 |* s1 w% ^7 \
} ) C W2 u9 @ H; e0 R: @( H0 t
x = getmaxx() / 2; 6 @ U1 A2 G/ @& G: D5 \! A
y = getmaxy() / 2;
$ C" S, [% l( ?6 m- ]: h, K/* output a message */ ( Q$ ^. l/ q4 ?
settextjustify(CENTER_TEXT, CENTER_TEXT); 0 t$ b( Y8 L7 t4 @/ D2 a- l
outtextxy(x, y, "Press a key to close the graphics system:");
) ]' U8 O3 m# T% ?" z) f/* wait for a key */
- }& y3 f5 Y1 [" lgetch(); $ L% {# X9 h% j d& o/ q
/* closes down the graphics system */ % i, }. M$ p# p# r( |& Q
closegraph(); # _" T. f" Q6 h8 D6 V7 l5 p
printf("We're now back in text mode.\n"); % K8 q* a, j. I6 W# M- N
printf("Press any key to halt:"); , m4 F1 u9 H9 [5 f z8 ^8 B
getch(); 6 _" ?9 [9 z4 F
return 0;
( k: `/ e3 `' H3 S" E} ' j! q- O7 U. d1 j; G7 F
9 M+ {2 A4 t9 T3 e5 G* Z8 q
+ ^3 ?7 {" y6 @/ y& Q3 g+ j$ @
2 N9 v% k5 n1 [/ ~ J9 r函数名: clreol
/ M5 c; @' A, b! Z/ ^2 Z功 能: 在文本窗口中清除字符到行末
, J5 J8 f: V" n; k4 k+ ]7 q# l用 法: void clreol(void);
u- `7 O1 i2 |( l程序例:
$ X$ l% c- C" F5 Q) H#include 4 A8 t! U/ c4 W, ?
int main(void) ' w5 g' a& f4 L5 Y8 |
{ 2 {0 U' @, B; O4 r1 C/ l
clrscr(); 5 T5 _4 ~7 L' r+ L/ |5 H, G
cprintf("The function CLREOL clears all characters from the\r\n"); $ I7 U. [" V @" K7 b2 q b# G6 E( j; w
cprintf("cursor position to the end of the line within the\r\n");
6 N& T- G- [1 K# S2 v9 }/ Ocprintf("current text window, without moving the cursor.\r\n");
$ U/ E5 E. [) c, v& ~1 U' K- ecprintf("Press any key to continue . . .");
- U/ w/ }5 d1 Ugotoxy(14, 4); 1 x' l: B* P; \! f$ K4 W
getch(); 7 P# V- ?! ]: b/ c$ z6 n
clreol();
" L+ s! {9 E/ X% I& |getch(); 3 y {8 {) \( h" K) Q+ Z
return 0;
; K& G: x& Z3 D4 K}
. X: Y; O; V) P1 C; S6 ?6 Q& @) C5 G; i
$ o% a, Q4 C8 N1 c: g& r8 m! ?2 z" H4 e
1 g% n* J4 W) w$ H0 T函数名: clrscr
0 B" P% @8 `. j. @功 能: 清除文本模式窗口
9 L e# M% d+ C3 V用 法: void clrscr(void); ' P! X0 @$ t0 O* A
程序例: : @9 a: H# H* E, m# S G: e
#include : \% ]8 e& J3 w0 L
int main(void) " ~* Y% G6 N4 U5 _1 H8 W' G( t
{
- t% @% L v; Q/ ~, Gint i; + A& i% z4 G/ |0 R% H: Q0 F2 f
clrscr();
0 n* d0 V5 e/ Gfor (i = 0; i < 20; i++) 6 b. A; ?! H! W7 w0 w* h
cprintf("%d\r\n", i);
6 \9 v. x/ X2 H9 B; ncprintf("\r\nPress any key to clear screen");
" I: O$ d! ^! E2 d7 q- r, Fgetch();
! B. |) \- p8 j5 _+ iclrscr(); : H+ O+ b/ i( R4 D+ d9 H5 }0 U" W5 ^
cprintf("The screen has been cleared!"); 9 Y. s4 @, L2 w
getch();
) x6 b0 l$ X! A) {! l: W! rreturn 0;
/ ]' x& i6 [% H) c: o8 }}
5 J1 ?0 b, U8 T z3 w2 v; O
! J5 |' R( p0 I! ]
: ~3 X C# ?8 F# i6 h# K2 F # m( {3 N9 F1 y8 ?# x9 v+ O
函数名: coreleft ' j) Y8 @3 f3 M. M
功 能: 返回未使用内存的大小
1 t; l' W) `3 F( X6 |6 c. \用 法: unsigned coreleft(void); ! u& h d. J) _8 _1 E4 \6 P
程序例:
! a% n4 [* R7 e% j, J) ?' q#include
# m7 c: C2 E$ H4 M#include
+ L. ?' r, v3 R' j0 Cint main(void) ' E: n+ |$ I' p. @3 ]3 @
{ 1 h" H+ X0 C" O0 F9 z4 D1 w1 K1 a! B
printf("The difference between the highest allocated block and\n");
/ j% m, E. ?/ B5 t8 }3 |, Yprintf("the top of the heap is: %lu bytes\n", (unsigned long) coreleft());
# A s% O$ l* z/ X: q) e7 f2 W6 kreturn 0; , u! q4 K2 s" c$ @7 {% `4 C
}
% f6 ?% W8 B, J, x7 X; ] & B( E& [& J- N8 J! ^
函数名: cos
# R; A& q0 [9 E- t8 Q功 能: 余弦函数
: s7 H& L, v* @ N# z9 z- L' X用 法: double cos(double x); 6 k, f" `: t& U# ]
程序例: , n- V" r* K5 y/ y# C9 j g
#include
t& i- M- Q- v1 D$ \# f" Q6 z5 }#include
( }% F D) `/ W! hint main(void) 0 I& p% |2 j' E4 e3 ]1 W- {
{
4 W1 r B% S4 u2 \6 D' udouble result; 6 Z+ j' ?. f- `9 P
double x = 0.5;
& e. Q7 Q' U" sresult = cos(x); , C! f3 J' F. R
printf("The cosine of %lf is %lf\n", x, result);
, A l! c0 A7 h+ }3 Z8 sreturn 0; $ b0 u! l( @/ c% {
}
, z4 X" `* e) ?/ J/ s, v4 j2 s
) p7 a) U- m0 M
$ z# l/ K, m& o0 |) i7 C $ M: Y2 F; b- z4 f" g- L
函数名: cosh % |- M/ H7 Y& U; b% ]! _
功 能: 双曲余弦函数 0 W8 {+ _1 D+ z1 ~( ?
用 法: dluble cosh(double x); 5 {! N! J6 I% s8 B+ f$ h
程序例:
2 J, D1 w, J9 Z" _* H1 j#include 3 f/ b' \8 N. B0 ]" z% p: L
#include
% c+ h7 O* g1 S6 Q. Bint main(void) ' K4 R: C" J o" g( H$ i N9 k
{
& f6 H# J9 {' e' Kdouble result; 0 V$ R: C6 b6 b# o# o( h; Z% f
double x = 0.5; 4 z k, C/ i2 X3 X' U) m/ i8 _# G
result = cosh(x); 5 n' S( u' o6 ?) ?) p9 j
printf("The hyperboic cosine of %lf is %lf\n", x, result);
. }% p5 `* g4 ] K: Ereturn 0;
3 \, w! _9 Y3 ~$ I. u: a} ! b3 m9 a% a7 s3 J! Q3 s" w5 o
- ]7 s$ `! L: Z* v. [0 ~3 z
+ d, m4 |7 ]8 f: H3 l7 I# v' X8 a7 D) o
) |# p% V) q1 S5 T
函数名: country ' g8 [/ G' `1 l9 G& x, P* s) f* ~$ j
功 能: 返回与国家有关的信息
0 P5 D6 E/ H& c/ t' R& a用 法: struct COUNTRY *country(int countrycode, struct country *country);
: P* ]2 d( O' g3 ?! ]; Z% S9 `* J( t" S% A程序例: 0 n/ x* _2 P/ {' \' I, M5 Q
#include
. R: K; N* I6 I/ w& |% O#include - X$ G o: w2 v
#define USA 0 6 q% p9 u7 Q* p7 G
int main(void) _7 p1 R5 g) I: u
{ ' e" j! d; m. b _
struct COUNTRY country_info; & a8 ~! y( k) N6 H9 T
country(USA, &country_info);
2 h, w7 @% V; S8 J* M. r% ^$ M: `printf("The currency symbol for the USA is: %s\n", 0 M5 c5 m" a# A8 w* n
country_info.co_curr);
) p1 z# @6 C2 F1 m+ @return 0; 7 G5 W, T; l; w, z- t& }+ v
}
6 R; a2 U5 ?' U4 p: K3 {+ b$ S- K. L, S9 l" L
" C m: f# M& y8 k$ g3 S+ |3 P# ?
7 x" W4 @2 e, ?$ k# S3 g
函数名: cprintf , r1 f9 Q: w! R# \5 |- L. r
功 能: 送格式化输出至屏幕 ' A3 T" U! P+ _, d. L
用 法: int cprintf(const char *format[, argument, ...]);
3 }; z% @4 d6 k$ r' _ u程序例: 1 x& E b1 e( P0 k' i7 ~% q: J1 ]
#include 0 k( d# s) V% H: [. M2 N1 b: X
int main(void) % |0 T1 d/ _! d8 t
{
0 X* r+ u, p; i/* clear the screen */ # W4 S% G3 y( |' \. ^$ U$ u
clrscr(); 2 F; i+ o m9 Z1 g/ {7 ?
/* create a text window */
0 h" v* u3 }! E/ \' Hwindow(10, 10, 80, 25); ! O- i/ `4 n$ n1 q3 N4 }
/* output some text in the window */ 4 E; k! \) y! I) A: J$ [ S
cprintf("Hello world\r\n");
( V$ J& m1 s) n/ b* S3 d5 n/* wait for a key */
4 T X0 g( ]0 ^5 c9 H! l/ ?getch();
& g: e5 Z9 y, K5 `return 0;
6 P) W+ n: C* W2 m1 Q! ] x9 B} 3 m& y; h& G( t s' b
- R+ l/ J' o: Z6 j7 _# A9 F) K p2 \1 p! p* v k3 T3 I
! p q3 u- `2 f3 J- x# n/ B
函数名: cputs & f. b; s) v' ]3 N5 a; w5 x# x
功 能: 写字符到屏幕 $ z9 h; _0 v* m; r5 [: {
用 法: void cputs(const char *string); * `6 N4 @" l2 r
程序例:
8 J) i. ?$ x, C#include
' J3 k: ^$ q# p* f# H& @8 C, t6 A0 Yint main(void) % F5 _0 E. z1 w4 W B4 b" ]
{ / T4 e1 X! j; ^& s' i! I& k
/* clear the screen */ 1 S4 q* y0 w5 n) r( x5 t
clrscr(); 2 c, j; i1 M+ @4 F7 @! Q
/* create a text window */
3 ?- L3 [# X/ ^; h7 Vwindow(10, 10, 80, 25);
9 \/ P$ g x: C) k/* output some text in the window */
2 _+ L$ a* J5 C1 Ecputs("This is within the window\r\n");
/ ` c5 T$ D: s0 b0 i% j( b* v/* wait for a key */ ; v3 b/ l4 Z J" c: K& h
getch();
5 G8 O* e# g/ h- [+ [( ]return 0;
+ D3 x# R+ w$ R8 a}
5 x* ^2 e, a5 l/ S# |9 M }
- h4 g2 w; |$ V5 s9 J
* O$ B: w( e/ N
( A; Z. y' v: x函数名: _creat creat ) Q7 k! m4 B4 m; k- ]. t
功 能: 创建一个新文件或重写一个已存在的文件
2 x' c9 e/ T/ o9 b用 法: int creat (const char *filename, int permiss);
. J. K) R1 E2 P m. w程序例:
3 }3 s- ^) d6 o) A#include $ g, L2 z, x# m) u Q
#include " ~6 l5 Q" X5 [- x8 W `
#include
8 }% O5 y, G& `4 O& h#include 3 g9 M& v: r. z
int main(void) a6 n8 |" E- f5 [* b
{ ; S4 w6 K" x; O+ a$ N, ^- E3 y% A
int handle; ( ] [2 G! r* E) J1 i1 l! O7 `
char buf[11] = "0123456789"; $ k: z( t, z: t, `9 u' ]
/* change the default file mode from text to binary */
1 H% f; o7 q, z: {- u_fmode = O_BINARY; # C N# N3 C0 o5 l: s, j4 T
/* create a binary file for reading and writing */
8 l; N9 K, z$ {: ^5 ^- yhandle = creat("DUMMY.FIL", S_IREAD | S_IWRITE); + k' @: e. h7 a' }/ @
/* write 10 bytes to the file */
. c; J8 p4 J0 V5 g1 bwrite(handle, buf, strlen(buf)); : S$ G2 c4 v( B; \3 L
/* close the file */ 9 U5 T/ r$ z }3 T3 Y6 D) G
close(handle);
3 O' h6 A1 D& L4 a' L1 z; f* Areturn 0;
6 a% X) |6 W; U' W' E} 3 Z! V9 K% o; b o2 p
/ l0 Y! y! H2 N3 P1 o
函数名: creatnew
5 k! c; {& w: x, u8 y功 能: 创建一个新文件
! ]) z m7 e% H7 H用 法: int creatnew(const char *filename, int attrib);
3 I6 m# [" b! K1 J$ P: x程序例: w% `/ B% F/ T& n( O1 G9 a# U
#include $ G% ~) L/ W5 w. s: i% l
#include ! _) i: e* o2 u6 C
#include
' Y. e6 `" y1 I) y7 s#include 4 c4 A, D. g& \" G6 n6 y
#include 5 y5 a+ |2 d1 {& r& ^$ m* t. [
int main(void) 0 i! N# w. _6 n; P) u7 z4 P
{
& c' [9 S! o' r0 I* e! Q% b8 [int handle; 0 X) n5 j Z6 A! }- v/ I
char buf[11] = "0123456789";
* D5 U4 o- p1 {' k: I, `; A) w3 ~/* attempt to create a file that doesn't already exist */ 8 ~$ v% y/ p# C0 v, {" _2 s
handle = creatnew("DUMMY.FIL", 0); - }0 Y& r# J0 r# Y% g1 j; U
if (handle == -1) , K. Q2 r5 h& _7 H$ k9 Z2 r# u- J
printf("DUMMY.FIL already exists.\n");
8 l6 S- O: T/ z: belse / N. O; O l* P& M; w7 G/ m' y
{
. y1 Y9 y" P) y( s8 s0 p* Hprintf("DUMMY.FIL successfully created.\n");
- F% K9 z$ {) Jwrite(handle, buf, strlen(buf)); ( u- b& u& L: O$ g- e' O- a. r
close(handle);
4 V! m' [5 O/ K& ^/ S}
, _1 t8 R& y( p, preturn 0; ; y: F1 I6 k" y& _: f+ X# U; u3 \
} ! q% x; r+ ^2 @8 n/ s" n
* S. i+ f7 @8 S; z$ S2 k+ l3 m, S0 K. ~
* j1 O# ^" L @4 C
函数名: creattemp
- _- I+ b, G; u0 A# ?: B功 能: 创建一个新文件或重写一个已存在的文件
7 M7 H- p( c- e, G用 法: int creattemp(const char *filename, int attrib); 7 d7 z& A7 u" E& y3 S Y# X7 L
程序例:
( p; g' c/ a( c; N0 v! S( W& r#include - v, X" Z) J0 b" h7 K. V6 F7 ]" A
#include : K& S+ \& j: a2 ^9 X) o" o/ h
#include
1 x: e" B1 K+ q7 A& ~int main(void)
8 o" e/ ]# {, k% ?{
7 V& {1 C {& K; o Q* F$ i7 {; Jint handle;
5 O; D& h8 M/ M) w' h* ]; Achar pathname[128]; ) z7 m) T1 r. _: F4 V
strcpy(pathname, "\\"); ~# X/ r: y6 A3 Q3 \( c
/* create a unique file in the root directory */
- |- ^# ~* ^; X1 Dhandle = creattemp(pathname, 0);
% c4 c3 _: \2 ^6 D3 }% M- i2 A! eprintf("%s was the unique file created.\n", pathname);
+ \. n2 V6 `. X. t; u6 a$ l# dclose(handle); ( @4 t0 B2 o& I" n2 Y u
return 0; 4 ]4 S3 J2 ^- G( v
}
% i6 b8 R; G6 q- [( x$ A/ Z
# i7 ^3 ^- D/ x7 Q3 g, ]6 g: ~; P6 S9 H
6 ^5 K V2 I" |
函数名: cscanf
$ {& _/ B! V9 A9 A. @" Z功 能: 从控制台执行格式化输入
0 S% v1 `; J0 }1 H l' ^" o用 法: int cscanf(char *format[,argument, ...]); 5 H2 L: u3 C0 F/ Z6 Z# [
程序例:
+ _, B+ s- [- o) n#include 6 K: w$ [5 m p& n2 ~1 [8 Z
int main(void) ; \, {/ ~; O1 w# D: j F
{
3 u# ^5 h1 J& _" g) @3 ~- Kchar string[80];
( Y6 [' F, H! z- ^/* clear the screen */
% Y0 B( x3 ~$ w. v: ]" x' _clrscr(); ' O/ w/ U% D: E5 R
/* Prompt the user for input */
, r9 C% L) k& G- N6 Lcprintf("Enter a string with no spaces:");
' w' Q' j% F1 A8 g/* read the input */
7 t% W+ s+ \3 Z6 j7 zcscanf("%s", string);
9 C( }7 v# y6 z, R7 E% X& [/* display what was read */ / l! y- P. H, l0 ]
cprintf("\r\nThe string entered is: %s", string);
, c. I2 |! V/ r [6 \# xreturn 0; ( t3 A9 }7 K) j: b8 t: n" h2 a
} 5 | ^0 u) g9 {5 L9 ?
7 T& A1 D! Q' \6 R9 Y' ]2 ^( X1 `/ h
+ U. ?% Z |! _1 V9 p3 `
v @9 a! Z# Q# N) }5 M. ]函数名: ctime
* m9 s/ b0 f- X, g+ M5 f功 能: 把日期和时间转换为字符串
2 F6 ] g% q9 M$ K3 h! ~用 法: char *ctime(const time_t *time); 3 |- k& J: r1 J1 w# v' A6 ~$ T
程序例: ! o& ]. w! f9 l; X
#include W% u6 O% `" e( }! \& }" a$ |
#include ' w. H+ k' L8 G
int main(void) . p+ `! n4 V; ~2 d8 N( D
{
g5 o% @/ z0 a. Q8 f6 W3 }3 ytime_t t; & v& p( [; J E5 H' Y
time(&t);
9 V; d5 G! Z/ q& V1 [printf("Today's date and time: %s\n", ctime(&t)); . q7 H7 d% F- q; A8 C: ^: n
return 0;
+ _9 T2 f" G. k- b( K5 _} ) U# u4 w9 `7 N/ D/ A* @
7 z+ H) G; x$ i. \' M# L4 z/ a6 I% Q& j4 g
# M& h4 n* H( T+ H
+ r- }2 W2 g6 Q# G
函数名: ctrlbrk & A; p' X6 K$ y2 K3 V
功 能: 设置Ctrl-Break处理程序
: G& }! }! g, ^6 h4 V$ J! w用 法: void ctrlbrk(*fptr)(void); ) @+ H' O7 S( V0 C/ l4 S0 p7 W
程序例:
9 q8 n. o8 O. a, }) D#include
, P2 X: G- Q/ c' ~ J#include
+ G! N- c7 m1 B+ e9 M1 K# A#define ABORT 0
& A- I0 k3 J# S; k* u* {int c_break(void) 5 ^) ?% Z3 @5 H; I) t
{ 1 T2 ^, p; Z1 U1 y! A8 I1 j \
printf("Control-Break pressed. Program aborting ...\n"); 8 f O$ J9 n5 N0 }
return (ABORT); 7 n: t( Y. B9 v7 A% D& g
}
. Z* H" ]/ m/ g# K% ~$ ~) ^5 H, C* Cint main(void)
- N3 [ V: V$ o* b. Z# y8 j7 a{
' y1 a n4 H6 @2 g9 M5 } U' wctrlbrk(c_break); 2 m5 _1 `! S9 Z& A8 r6 v# M
for(;;)
z: @! a! j1 O2 G{ & g& t6 G: m& W+ e) V9 T
printf("Looping... Press to quit:\n");
% x; D# v1 [2 D( M! O} - n `+ U& e2 J
return 0; 2 _( V2 N- V$ ~2 O+ p# C! Y3 ]4 b
} |