Chinese Translation of the C FAQ
|
|
|
- 坊 裘
- 7 years ago
- Views:
Transcription
1 C Steve Summit, 0.9.3, c 2005
2
3 C FAQ ( ) Steve Summit The English version of this FAQ list is Copyright by Steve Summit. Content from the book C Programming FAQs: Frequently Asked Questions is made available here by permission of the author and the publisher as a service to the community. It is intended to complement the use of the published text and is protected by international copyright laws. The on-line content may be accessed freely for personal use but may not be republished without permission. HTML PDF c-faq-chn L A TEX Steve Summit ([email protected]), ([email protected], 1 12 ) (zhu.qunying@ gmail.com, L A TEX )
4
5 i extern auto typedef struct { char *item; NODEPTR next; } *NODEPTR; C N ,, main() void main() , int f() { char a[] = "Hello, world!";} char *p = malloc(10); char a[] = "string literal"; char *p = "string literal"; p[i], , struct x1 {... }; typedef struct {... } x2; struct x {... }; x thestruct; C? C... 7 i
6 ii 2.6 : struct name { int namelen; char namestr[1];}; namestr / / ,,? sizeof,? , core dump #define : a[i] = i++; , int i=7; printf("%d\n", i++ * i++); 49, int i = 3; i = i++;, 3, 4, : a ˆ= b ˆ= a ˆ= b a b && while((c = getchar())!= EOF && c!= \n ) , a[i] = i++; a[], i 1, i i , ++i i int a = 100, b = 100; long int c = a * b; ((condition)? a : b) = complicated expression;
7 iii , char *p; *p = malloc(10); *p++ p p char * int, ((int *)p)++; , void f(int *ip) { static int dummy = 5; ip = &dummy;} : int *ip; f(ip); void**, extern int f(int *); int f(&5); C int char *, (null) if(p) NULL, , NULL NULL #define NULL ((char *)0) NULL NULL 0, NULL,, NULL ( 0) #define Nullptr(type) (type *) NULL 0, (null) , ,, 26
8 iv char a[6], extern char *a char a[ ] char *a , C , , , , 5["abcdef"] C , arr, arr &arr : int realarray[10]; int *array = &realarray[-1]; array , , sizeof char *answer; printf("type something:\n"); gets(answer); printf("you typed \"%s\"\n", answer); strcat(). char *s1 = "Hello, "; char *s2 = "world!"; char *s3 = strcat(s1, s2); strcat char * ( ) char *p; strcpy(p, "abc"); ,,,
9 v malloc(), : malloc malloc(), void * int * char *p = malloc(strlen(s) + 1); strcpy(p, s); malloc((strlen(s) + 1) * sizeof(char)) malloc , : double *array = malloc(300 * 300 * sizeof( double )); malloc() null,,, malloc(), PC 8 640K , malloc malloc() bug , free() (, ) malloc(), free() ,, ,, free() malloc, realloc() calloc() malloc() calloc free() calloc(), cfree() alloca() strcat(string,! ); char *string;... if(string == "value") { /* string matches value */... }
10 vi 8.3 char a[] = "Hello, world!"; char a[14]; a = "Hello, world!"; ( ), : sizeof( a ) 2 1 (, sizeof(char)) C #define enum true false C, TRUE p, if(p) C : #define begin { #define end } ,.c,.h (.h ) #include <> #include "" , , , #if sizeof #if #include #ifdef typdef #ifdef #if , #ifdef #include #ifdef,
11 vii 10.18, #define Paste(a, b) a/**/b #define TRACE(n) printf("trace: %d\n", n) TRACE(count); printf("trace: %d\count", count); #, , ANSI/ISO C ANSI C ANSI extern int func(float); int func(x) float x; { extern int f(struct x *p); x : const int n = 5; int a[n]; , const char *p char * const p const char ** char ** main() main() void, main main() envp main() void, exit() return, / void main() C void main() main(), exit(status) status ANSI #, warning: macro replacement within a string literal #ifdef #pragma, #pragma once.. 59
12 viii a[3] = "abc"; void* memcpy() memmove() malloc(0) ANSI ASNI/ISO ANSI C ANSI C, ANSI Frobozz Magic C ANSI, gcc (implementation-defin-ed) (unspecified) (undefined) , , ANSI i = i++, ANSI, char c; while((c = getchar())!= EOF) EOF, EOF while(!feof(infp)) { fgets(buf, MAXLINE, infp); fputs(buf, outfp); } , printf % \%, printf %lf, scanf() %lf, printf() %f size t, long, printf printf, %8d scanf("%d", i) char s[30]; scanf("%s", s); &
13 ix double d; scanf("%f", &d); scanf() %d\n scanf, scanf %d, gets(), gets() , scanf(), scanf() sprintf sprintf() gets() printf() errno ENOTTY fgetops/fsetops ftell/fseek fgetops() fsetops() , fflush(stdin) fflush(), fopen() r+,,, stdin stdout freopen(), stdout ( stdin) , x0a 0x0d, 0x1a, EOF ( atoi ) itoa() strncpy() \ toupper() toupper() tolower() main() argc argv strcmp(), qsort(), qsort(), qsort()
14 x C localtime() time t struct tm, ctime() time t, struct tm time t N , rand() /, rand() % 2, 0, 1, 0, 1, , #inlude , end printf float 3.1, printf , , #include <math.h>, undefined: sin ( sin ) , C <math.h> M PI IEEE NaN C (FFT) ( ) Turbo C, floating point formats not linked ( ) printf(), #include <stdio.h>
15 xi 15.2 %f printf(), float double n long int, printf("%d", n); ANSI printf(), printf() scanf(), scanf() float, va arg(argp, float) va arg() , , ,, main() , main() ,,, : char *p = "hello, worl!"; p[0] = H ; Segmentation violation, Bus error General protection fault C if(!strcmp(s1, s2)), if (0 == x) if (x == 0) extern int func ((int, int));, printf(), (void) (Hungarian Notation) (Indian Hill Style Guide)
16 xii 17.8 goto, malloc ANSI lint ANSI lint C , C C C ANSI/ISO C C BNF YACC C RETURN ,,, , ( comm ) GIF JPEG ,
17 xiii ( ) fopen("c:\ newdir \file.dat", "r") fopen() : "$HOME/.profile" " /.myrcfile" MS-DOS Abort, Retry, Ignore? Too many open files (, C K DGROUP data allocation exceeds 64K (DGROUP 64K), 64K ( ) C (, ) , control-c socket / BIOS ISR TSR , union REGS int86() near far , ANSI! , char *
18 xiv printf() i i = i ,, i/= case ( ) return C C a+++++b C assert() C FORTRAN (C++, BASIC, Pascal, Ada, LISP) Pascal Fortran ( LISP, Ada, awk, C) C C++ C C++ C strcmp,, , (year%4 == 0) : (Duff s Device) C (IOCCC) [K&R1] entry C char lvalue rvalue
19 xv FAQ ( )
20 xvi
21 1 1.1 ( 32, , 767), long, ( ), short, int,,, ( ), ; 12.1,, C99 <inttypes.h> typedef,, 20.3 C, : [K&R1, Sec. 2.2 p. 34]; [K&R2, Sec. 2.2 p. 36, Sec. A4.2 pp , Sec. B11 p. 257]; [ISO, Sec , Sec ]; [H&S, Secs. 5.1,5.2 pp ] C99 long long, 64, longlong, , : [C9X, Sec , Sec ] 1
22 , ( ), ( ).c, (.h),,.c, : ANSI C, ANSI Unix, ; ANSI C, DEFINE(int, i);,,,.c :, : [K&R1, Sec. 4.5 pp. 76-7]; [K&R2, Sec. 4.4 pp. 80-1]; [ISO, Sec , Sec. 6.7, Sec , Sec. G.5.11]; [Rationale, Sec ]; [H&S, Sec. 4.8 pp , Sec p. 267]; [CT&P, Sec. 4.2 pp ]. 1.4 extern, extern int f(); int f(); : [ISO, Sec , Sec ]; [Rationale, Sec ]; [H&S, Secs. 4.3,4.3.1 pp. 75-6]. 1.5 auto : [K&R1, Sec. A8.1 p. 193]; [ISO, Sec , Sec ;]; [H&S, Sec. 4.3 p. 75, Sec p. 76].
23 typedef struct { char *item; NODEPTR next; } *NODEPTR; C C ; [K&R2, 6.5 ] NODEPTR next typedef, ( struct node ), next struct node *, typedef, : struct node { char *item; struct node *next; }; typedef struct node *NODEPTR; typedef, 2.1 : [K&R1, Sec. 6.5 p. 101]; [K&R2, Sec. 6.5 p. 139]; [ISO, Sec , Sec ]; [H&S, Sec pp ] 1.7 N 3 : 1. char *(*(*a[n])())(); 2. typedef : typedef char *pc; /* */ typedef pc fpc(); /* */ typedef fpc *pfpc; /* */ typedef pfpc fpfpc(); /* */ typedef fpfpc *pfpfpc; /* */ pfpfpc a[n]; /* */ 3. cdecl, C C : cdecl> declare a as array of pointer to function returning pointer to function returning pointer to char char *(*(*a[])())(), cdecl, ( ) 18.1
24 1 4 C C ( ), cdecl : [K&R2, Sec p. 122]; [ISO, Sec. 6.5ff (esp. Sec )]; [H&S, Sec. 4.5 pp , Sec pp ] 1.8,, ( ) (int) ( ), ( ) : [K&R1, Sec. 4.2 p. 70]; [K&R2, Sec. 4.2 p. 72]; [ISO, Sec ]; [H&S, Sec. 4.7 p. 101]. 1.9 main() void main() ( ) 1.10, (, ), =0,, 0.0 (, 5 ) (, ), ( );, malloc() realloc(), calloc(), ( ) : [K&R1, Sec. 4.9 pp. 82-4]; [K&R2, Sec. 4.9 pp ]; [ISO, Sec , Sec , Sec ]; [H&S, Sec pp. 72-3, Sec. 4.6 pp. 92-3, Sec pp. 94-5, Sec p. 96, Sec p. 386.]
25 int f() { char a[] = "Hello, world!";} ANSI, (automatic aggregates, ) char *p = malloc(10); ( ) 1.13 char a[] = "string literal"; char *p = "string literal"; p[i], ( char a[] ),,,,, ( 6 ), p, : [K&R2, Sec. 5.5 p. 104]; [ISO, Sec , Sec ]; [Rationale, Sec ]; [H&S, Sec pp. 31-2] 1.14, extern int func(); int (*fp)() = func;, (, ), ( ) ( )
26 1 6
27 2 2.1 struct x1 {... }; typedef struct {... } x2; ; struct x1, x2,, struct 2.2 struct x {... }; x thestruct; C C C? ( ), ( ) 2.5 C,,, (, ),,,, C++ 7
28 : struct name { int namelen; char namestr[1];}; namestr, Dennis Ritchie C C,, ; :... char namestr[maxsize]; MAXSIZE name,,, C99, : [Rationale, Sec ]; [C9X, Sec ] 2.7 (, == ), C ( 2.10) ;, : [K&R2, Sec. 6.2 p. 129]; [Rationale, Sec ]; [H&S, Sec p. 133] 2.8 C ; C99 (compound literals);, plotpoint(), plotpoint((struct point){1, 2}); (designated initializers) (C99 ), : plotpoint((struct point){.x=1,.y=2}); 4.6 : [C9X, Sec , Sec ]
29 / / fwrite() : fwrite(&somestruct, sizeof somestruct, 1, fp); fread() ( ),,,,, b ; 12.30, ( ), : [H&S, Sec p. 381] 2.10,,?,,, ( ) (, char ), 2 4 ( #pragma; 11.21), 20.3 : [K&R2, Sec. 6.4 p. 138]; [H&S, Sec p. 135] 2.11 sizeof,?,,, sizeof 2.10 : [H&S, Sec pp ] 2.12 ANSI C <stddef.h> offsetof(), offsetof(struct s, f) f s,, : 292-3] #define offsetof(type, f) ((size_t) \ ((char *)&((type *)0)->f - (char *)(type *)0)) 100% ; : [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec pp.
30 offsetof() ( 2.12) structp, f, offsetf, f : *(int *)((char *)structp + offsetf) = value; 2.14, core dump : struct list { char *item; struct list *next; } /* main */ main(argc, argv) {... } main(),,,, main(), (, C ) : [CT&P, Sec. 2.3 pp. 21-2] 2.15 ANSI C, C99, : [K&R2, Sec. 6.8 pp ]; [ISO, Sec ]; [C9X, Sec ]; [H&S, Sec p. 100] 2.16 #define C, : ;, ;,, ; : [K&R2, Sec. 2.3 p. 39, Sec. A4.2 p. 196]; [ISO, Sec , Sec , Sec , Annex F]; [H&S, Sec. 5.5 pp , Sec p. 153]
31 ,,,
32 2 12
33 3 3.1 : a[i] = i++; i++ i i,, ( a[i] ) (, K&R, C, : [K&R1, Sec. 2.12]; [K&R2, Sec. 2.12]; [ISO, Sec. 6.3]; [H&S, Sec pp ] 3.2, int i=7; printf("%d\n", i++ * i++); 49, , ( ANSI C,, 3.7), (,, ; 3.7, ) ( C ); K&R,, : [K&R1, Sec p. 50]; [K&R2, Sec p. 54]; [ISO, Sec. 6.3]; [H&S, Sec pp ]; [CT&P, Sec. 3.7 p. 47]; [PCS, Sec. 9.5 pp ] 13
34 int i = 3; i = i++;, 3, 4, ; 3.1, , i++ ++i i+1 i 1, i=i+1, i+=1, i++ ++i,, : a ˆ= b ˆ= a ˆ= b a b a,, : int a = 123, b = 7654; a ^= b ^= a ^= b; SCO C (icc) b 123, a ,. f() + g() * h(),, : [K&R1, Sec p. 49, Sec. A.7 p]; [K&R2, Sec pp. 52-3, Sec. A.7 p. 200.] 3.6 && while((c = getchar())!= EOF && c!= \n ) : (, && ),,, (? : ) ( 3.7) : [K&R1, Sec. 2.6 p. 38, Secs. A pp ]; [K&R2, Sec. 2.6 p. 41, Secs. A pp ]; [ISO, Sec , Sec , Sec ]; [H&S, Sec. 7.7 pp , Sec. 7.8 pp , Sec p. 229]; [CT&P, Sec. 3.7 pp. 46-7]
35 ( &&? :, ),, ANSI/ISO C :,, i = i+1, a[i] = i++ ( 3.1) 3.8 : [ISO, Sec , Sec. 6.3, Sec. 6.6, Annex C]; [Rationale, Sec ]; [H&S, Sec pp ] 3.8, a[i] = i++; a[], i 1,, 3.2, 3.3, i i++ C, : ++i i, ; i++ i, 3.10, ++i i++,,, C++, int a = 100, b = 100; long int c = a * b; C, int, long c, long : long int c = (long int)a * b;
36 3 16, (long int)(a * b),, : [K&R1, Sec. 2.7 p. 41]; [K&R2, Sec. 2.7 p. 44]; [ISO, Sec ]; [H&S,, ]; [CT&P, Sec. 3.9 pp ] 3.12 ((condition)? a : b) = complicated expression;? :,,,,? :, : *((condition)? &a : &b) = complicated_expression; : [ISO, Sec ]; [H&S, Sec. 7.1 pp ]
37 4 4.1, char *p; *p = malloc(10); p, *p, (, ), : p = malloc(10);, * : *p = H ; 1.7, 7.1, : [CT&P, Sec. 3.1 p. 28] 4.2 *p++ p p ++ --, *p++ *(p++), p p p, (*p)++, ++*p : [K&R1, Sec. 5.1 p. 91]; [K&R2, Sec. 5.1 p. 95]; [ISO, Sec , Sec ]; [H&S, Sec pp , Sec. 7.5 p. 193, Secs ,7.5.8 pp ] 4.3 char * int, ((int *)p)++; C,, ;, (rvalue), ++ (,, ) : p = (char *)((int *)p + 1);, p char *, p += sizeof(int);,,, : [K&R2, Sec. A7.5 p. 205]; [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec. 7.1 pp ] 17
38 , void f(int *ip) { static int dummy = 5; ip = &dummy;} : int *ip; f(ip); C, ( ), void**, C void*,, ;, void* void**, 4.6 extern int f(int *); int f(&5); C99, : f((int[]){5}); C99, ;, : int five = 5; f(&five); 2.8, C, C,, &, ( 6.4 ), C C++, : [K&R1, Sec. 1.8 pp. 24-5, Sec. 5.2 pp. 91-3]; [K&R2, Sec. 1.8 pp. 27-8, Sec. 5.2 pp. 95-7]; [ISO, Sec ]; [H&S, Sec. 9.5 pp ]
39 , * ( ) : int r, func(), (*fp)() = func; r = (*fp)();, (, 1.14) fp r = fp(); ANSI C, *, 1.14 : [K&R1, Sec p. 116]; [K&R2, Sec p. 120]; [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec. 5.8 p. 147, Sec p. 190] 4.9 int char *,,, 13.1, 8.4, 19.29
40 4 20
41 5 (null) 5.1,,, &, malloc(),, malloc(), : ; ,,,, ( ) [K&R1, Sec. 5.4 pp. 97-8]; [K&R2, Sec. 5.4 p. 102]; [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec pp ] 5.2, 0,,, 0 char *p = 0; if(p!= 0) 5.3,, 0, 0, Unix execl execl("/bin/sh", "sh", "-c", "date", (char *)0); (char *),, 0 ( Unix ) 21
42 5 (null) 22,,,, 0 ( 15.3) : 0: :, [K&R1, Sec. A7.7 p. 190, Sec. A7.14 p. 192]; [K&R2, Sec. A7.10 p. 207, Sec. A7.17 p. 209]; [ISO, Sec ]; [H&S, Sec p. 95, Sec p. 171] 5.3 if(p) 0 C, 0,, if(expr) expr, if((expr)!= 0) p expr if(p) if(p!= 0), 0, ;,! :!expr (expr) 0:1 ((expr) == 0) if(!p) if(p == 0) if(p),, ( ; 17.8) 9.2 [K&R2, Sec. A7.4.7 p. 204]; [ISO, Sec , Sec , Sec , Sec , Sec , Sec , Sec ]; [H&S, Sec p. 122]
43 5 (null) NULL,, 0 NULL ( <stdio.h> ), 0 ((void *)0) ( 5.6) 0 0 NULL NULL ; NULL 0, 0,, NULL ( 0 ) NULL ( NULL 0 ) NULL ; 5.7 [K&R1, Sec. 5.4 pp. 97-8]; [K&R2, Sec. 5.4 p. 102]; [ISO, Sec , Sec ]; [Rationale, Sec ]; [H&S, Sec p. 122, Sec p. 292] 5.5, NULL : 0 ( 0; 5.4), 0 NULL,, 0 NULL [ISO, Sec ]; [Rationale, Sec ] 5.6 NULL #define NULL ((char *)0) NULL,, NULL, ( ), FILE *fp = NULL;, ANSI C NULL #define NULL ((void *)0) (, ), NULL (, ASCII NUL ; 5.7), ANSI ( ; 5.2), [Rationale, Sec ]
44 5 (null) NULL 0, NULL, 0,, 0 ( ) C, NULL 0, 0 NULL ( 0 ), ; ( ) 0 0 0, NULL, (, ANSI NULL ((void *)0),, ASCII (NUL) NULL, #define NUL \0 [K&R1, Sec. 5.4 pp. 97-8]; [K&R2, Sec. 5.4 p. 102] 5.8 NULL,, NULL ( 0) ( NULL, ), NULL 0 0 ( ) NULL #define Nullptr(type) (type *)0,, ; NULL 0, (null) null NULL, : 1., ( ),, C,
45 5 (null) 25 3., 0 ( 5.2) 4. NULL, 0 ( 5.4) 5. ASCII (NUL),,, ; 6. (null string), ("") C, ( \0 ),, ( null pointer, ), 0 3, NULL C ( ) (NULL) if(p == 0) p, 0, ( 5.10 ) C ( Pascal, nil ) nil,, C nil 0,, 0, 0, 0, 5.12 : 1., 0 NULL 2. 0 NULL,, ( ), (, 2 ; ) ,
46 5 (null) , 0,,,,, ( calloc() ; 7.26), int ( 5.11, nil, 0 ) 5.14,, PL/I, Prime , 0 0, 0 C, TCNP ( C ) C Prime (char *) (int *) Data General Eclipse MV ( ), C char * void *, Honeywell-Bull ( ) CDC Cyber 180 (ring), 48 ( 11 ) 0xB CDC 1,, HP 3000 ;, char * void * Symbolics Lisp, ; <NIL, 0> ( <, > ) C, 8086 (PC ) 16 32, 64 Cray 48 int *; char * 16 [K&R1, Sec. A14.4 p. 211] 5.15, MS-DOS, ( 0 ) 16.7
47 6 6.1 char a[6], extern char *a, extern char * T T extern char a[ ] 64-5] [ISO, Sec ]; [CT&P, Sec. 3.3 pp. 33-4, Sec. 4.5 pp. 6.2 char a[ ] char *a ( 6.4) char a[6] 6, a, a, 6 char *p,, p :, ( ) char a[] = "hello"; char *p = "world"; : a: h e l l o \ p: *======> w o r l d \ x, x[3], a[3], a 3,. p[3], p,, 3, a[3] a ( ) 3, p[3] p 3., a[3] p[3] l, a p 27
48 6 28, 1.13 [K&R2, Sec. 5.5 p. 104]; [CT&P, Sec. 4.5 pp. 64-5] 6.3, C C,, : T ( ); T,,, &a[0], sizeof &,, a[i],, p[i], 6.2, : p = a; p[3] a[3] [K&R1, Sec. 5.3 pp. 93-6]; [K&R2, Sec. 5.3 p. 99]; [ISO, Sec , Sec , Sec ]; [H&S, Sec p. 124] 6.4,,,, void f(char a[]) {... },,. void f(char *a) {... },, ;,
49 [K&R1, Sec. 5.3 p. 95, Sec. A10.1 p. 205]; [K&R2, Sec. 5.3 p. 100, Sec. A8.6.3 p. 218, Sec. A10.1 p. 226]; [ISO, Sec , Sec , Sec ]; [H&S, Sec. 9.3 p. 271]; [CT&P, Sec. 3.3 pp. 33-4] 6.5, 179] ANSI C, : [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec. 7.1 p. 6.6,, ( malloc), (, ),, ( 6.3),, malloc ( [ ] ) , sizeof ,,, , 5["abcdef"] C, 1, C, a e,, a[e] *((a)+(e)) C, C, : [Rationale, Sec ]; [H&S, Sec p. 124, Sec pp ] 1, 1897, (Virginia),,, Yes, Virginia, there is a Santa Claus, santa/virginia s question.htm
50 , arr, arr &arr C, &arr T, ANSI C, &arr &, C, ( & ) T, 6.3, : [ISO, Sec , Sec ]; [Rationale, Sec ]; [H&S, Sec p. 198] 6.10,,, T T ( 6.3), ;,,, 6.15, int (*ap)[n]; N ( 1.7), N,,, 6.9 : [ISO, Sec ] 6.11 ( 6.3), malloc #include <stdlib.h> int *dynarray; dynarray = malloc(10 * sizeof(int)); ( malloc ), dynarry[i] (i 0 9) sizeof , ; C, C99 (VLA), ;
51 6 31, ( gcc ) C99 gcc, malloc(), free() 6.11, 6.13, 6.16, : [ISO, Sec. 6.4, Sec ]; [C9X, Sec ] 6.13, : #include <stdlib.h> int **array1 = malloc(nrows * sizeof(int *)); for(i = 0; i < nrows; i++) array1[i] = malloc(ncolumns * sizeof(int));,, malloc sizeof(*array1) sizeof(**array1) sizeof(int *) sizeof(int),, : int **array2 = malloc(nrows * sizeof(int *)); array2[0] = malloc(nrows * ncolumns * sizeof(int)); for(i = 1; i < nrows; i++) array2[i] = array2[0] + i * ncolumns;, arrayx[i][j] (for 0 <= i <nrows 0 <= j <ncolumns), : int *array3 = malloc(nrows * ncolumns * sizeof(int));,, array3[i * ncolumns + j] i, j,,, 6.16 : int (*array4)[ncolumns] = malloc(nrows * sizeof(*array4));,, ( ; 7.20) , C99 : [C9X, Sec ]
52 : int realarray[10]; int *array = &realarray[-1]; array 1 ( Numerical Recipes in C ), C, ;,, ( ), : [K&R2, Sec. 5.3 p. 100, Sec. 5.4 pp , Sec. A7.7 pp ]; [ISO, Sec ]; [Rationale, Sec ] 6.15, ( 6.3) ( C ),, ; 6.10 : int array[nrows][ncolumns]; f(array); : void f(int a[][ncolumns]) {... } void f(int (*ap)[ncolumns]) /* ap */ {... }, ( );,, NROWS, NCOLUMNS (, ), : [K&R1, Sec p. 110]; [K&R2, Sec. 5.9 p. 113]; [H&S, Sec p. 126] 6.16 [0][0],
53 6 33 void f2(int *aryp, int nrows, int ncolumns) {... array[i][j] is accessed as aryp[i * ncolumns + j]... } 6.15 : f2(&array[0][0], NROWS, NCOLUMNS);,, ANSI C ;, x >= NCOLUMNS, &array[0][0][x] C99, C99, VLA gcc, , 6.17, 6.12 : [ISO, Sec ]; [C9X, Sec ] 6.17 int array[nrows][ncolumns]; int **array1; /* */ int **array2; /* */ int *array3; /* " " */ int (*array4)[ncolumns]; 6.13, void f1a(int a[][ncolumns], int nrows, int ncolumns); void f1b(int (*a)[ncolumns], int nrows, int ncolumns); void f2(int *aryp, int nrows, int ncolumns); void f3(int **pp, int nrows, int ncolumns); f1a() f1b(), f2(), f3() ( ), : f1a(array, NROWS, NCOLUMNS); f1b(array, NROWS, NCOLUMNS); f1a(array4, nrows, NCOLUMNS); f1b(array4, nrows, NCOLUMNS); f2(&array[0][0], NROWS, NCOLUMNS); f2(*array, NROWS, NCOLUMNS); f2(*array2, nrows, ncolumns); f2(array3, nrows, ncolumns); f2(*array4, nrows, NCOLUMNS); f3(array1, nrows, ncolumns); f3(array2, nrows, ncolumns);,, ncolumns NCOLUMNS :
54 6 34 f1a((int (*)[NCOLUMNS])(*array2), nrows, ncolumns); f1a((int (*)[NCOLUMNS])(*array2), nrows, ncolumns); f1b((int (*)[NCOLUMNS])array3, nrows, ncolumns); f1b((int (*)[NCOLUMNS])array3, nrows, ncolumns); f2() &array[0][0] ( *array) ; 6.16,, C,, array1 array2 f3() 6.18, sizeof ( 6.4), : [H&S, Sec p. 195]
55 7 7.1 char *answer; printf("type something:\n"); gets(answer); printf("you typed \"%s\"\n", answer); answer, gets(),,, answer,, answer :,, #include <stdio.h> #include <string.h> char answer[100], *p; printf("type something:\n"); fgets(answer, sizeof answer, stdin); if((p = strchr(answer, \n ))!= NULL) *p = \0 ; printf("you typed \"%s\"\n", answer); fgets() gets(), array 12.20, fgets() gets() \n malloc() answer 7.2 strcat(). char *s1 = "Hello, "; char *s2 = "world!"; char *s3 = strcat(s1, s2); 7.1, C C (, ), malloc() strcat() ;, : char s1[20] = "Hello, "; 35
56 7 36 strcat(), s1, s3 ; strcat(), s1 strcat() : s1,, 1.13 : [CT&P, Sec. 3.2 p. 32] 7.3 strcat char * ( ),,,, Unix ANSI C, ( ) (, ) time() ( 13.10) stat() 7.4 char *p; strcpy(p, "abc");, p, , char *p; (,, ) ;,, sizeof(char*) ,,,, : char *itoa(int n) { char retbuf[20]; /* */ sprintf(retbuf, "%d", n); return retbuf; /* */ }
57 7 37 static char retbuf[20];,, 7.7, : [ISO, Sec ] 7.7 ( 7.6 ),, malloc(), ( ) malloc(), : <stdlib.h> malloc() 1.8 : [H&S, Sec. 4.7 p. 101] 7.9 malloc ANSI/ISO C void *, ( ) ANSI/ISO C,,, malloc() ; 7.8 (,, C++, C C++ void * ) : [H&S, Sec pp ] 7.10 malloc(), void * int * C++ C char *p = malloc(strlen(s) + 1); strcpy(p, s); malloc((strlen(s) + 1) * sizeof(char)) sizeof(char),, sizeof(char) 1, sizeof(char), size t 8.5 : [ISO, Sec ]; [H&S, Sec p. 195]
58 malloc, : [ISO, Sec ] 7.14, : double *array = malloc(300 * 300 * sizeof( double )); malloc() null,,, malloc(), 300 * ,000, sizeof(double) 16 int, size t (malloc() ) 32, int 16, 300 * (300 * sizeof(double)) ( 3.11),, 32, PC 8 640K PC, 640K, MS-DOS , malloc malloc() bug, malloc, malloc ; bug malloc(strlen(s)) strlen(s) + 1, malloc,,, , , malloc(), C
59 7 39, : struct list *listp, *nextp; for(listp = base; listp!= NULL; listp = nextp) { nextp = listp->next; free(listp); } nextp, listp = listp-> next : [K&R2, Sec p. 167]; [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec p. 387]; [CT&P, Sec p. 95] 7.18 free() (, ) free(),,, C 4.4,,,,,, : [ISO, Sec ]; [Rationale, Sec ] 7.19 malloc(), free(),,, malloc(), malloc() free() 7.20,,, free() malloc(), ( ) malloc(), free() malloc() 7.21
60 ,, ANSI/ISO C : [ISO, Sec ] 7.22,, malloc/free, malloc() 7.23 free() malloc/free, 7.24 malloc,, 7.25 realloc() ANSI C, realloc(..., 0),,, realloc() : [ISO, Sec ]; [H&S, Sec p. 388] 7.26 calloc() malloc() calloc free() calloc(), cfree() calloc(m, n) p = malloc(m * n); memset(p, 0, m * n);, ( 5 ) free() calloc() : [ISO, Sec to ]; [H&S, Sec p. 386, Sec p. 386]; [PCS, Sec. 11 pp. 141,142]
61 alloca() alloca(),, alloca alloca(),, fgets(alloca(100), 100, stdin), alloca(),, C99 (VLA), alloca() 7.19 : [Rationale, Sec ]
62 7 42
63 8 8.1 strcat(string,! );, strcat() C, 8.4 ;!, strcat(string, "!"); 1.13, : [CT&P, Sec. 1.5 pp. 9-10] 8.2 char *string;... if(string == "value") { /* string matches value */... } C, C (, ) == string value,,,, strcmp(): if(strcmp(string, "value") == 0) { /* string matches "value" */ } 8.3 char a[] = "Hello, world!"; char a[14]; a = "Hello, world!";, strcpy() : strcpy(a, "Hello, world!"); 1.13,
64 ( ), C, :, 0-9, 0,, : sizeof( a ) 2 1 (, sizeof(char)), C int, sizeof( a ) sizeof(int), C : [ISO, Sec ]; [H&S, Sec p. 29]
65 9 9.1 C #define enum true false C, / ( int, char, int, ) #define true/false, ( ) #define TRUE 1 #define YES 1 #define FALSE 0 #define NO 0 enum bool {false, true}; enum bool {no, yes}; 1 0,, #define TRUE (1==1) #define FALSE (!TRUE) #define Istrue(e) ((e)!= 0), 9.2, C, TRUE 1 1 C,,,, 1 0, if((a == b) == TRUE) ( TRUE 1),, TRUE FALSE TRUE FALSE, ( isupper(), isalpha() ), 1 (, if((a == b) 45
66 9 46 == TRUE) if(a == b), if(((a == b) == TRUE) == TRUE)?) TRUE FALSE ( ),, TRUE FALSE ( NULL), ( ) TRUE FALSE ( YES NO), C TRUE FALSE, : [K&R1, Sec. 2.6 p. 39, Sec. 2.7 p. 41]; [K&R2, Sec. 2.6 p. 42, Sec. 2.7 p. 44, Sec. A7.4.7 p. 204, Sec. A7.9 p. 206]; [ISO, Sec , Sec , Sec , Sec , Sec , Sec , Sec , Sec ]; [H&S, Sec pp , Sec pp , Sec pp , Sec. 7.7 pp , Sec. 7.8 pp , Sec. 8.5 pp , Sec. 8.6 pp ]; What the Tortoise Said to Achilles 9.3 p, if(p). 5.3
67 10 C 10.1 : #define begin { #define end } ,,, ( ) ( ),, ( ), C typeof, 10.3,,, (, ), if/else if else, : #define MACRO(arg1, arg2) do { \ /* declarations */ \ stmt1; \ stmt2; \ /*... */ \ } while(0) /* ; */, 0, lint,,,,, DEBUG() : [H&S, Sec p. 45]; [CT&P, Sec. 6.3 pp. 82-3] 47
68 10 C ,.c,.h (.h ), (.h) : ( #defines) typedef ( 1.4),,.c 1.3,.c,.c : [K&R2, Sec. 4.5 pp. 81-2]; [H&S, Sec p. 267]; [CT&P, Sec. 4.6 pp. 66-7] 10.5, : (Indian Hill Style Guide, 17.7) ; ;, ; makefile, (, ); grep ( tags ), ; : #ifndef HFILENAME_USED #define HFILENAME_USED #endif ; Makefile (, ) 17.8 : [Rationale, Sec ] 10.6 #include <> #include "" <>, ""
69 10 C ; 11.32, <> "", ( ) : [K&R2, Sec. A12.4 p. 231]; [ISO, Sec ]; [H&S, Sec. 3.4 p. 55] 10.8, 2.14, , ,,,,, <stdlib.h> <malloc.h>,,,,. ( 19 ), #if ; #if, : [K&R2, Sec p. 91; ISO Sec ]; [H&S, Sec p. 225]
70 10 C sizeof #if,, ANSI <limits.h>, (configure), ; #include #ifdef #ifdef #define : [ISO, Sec , Sec ]; [H&S, Sec. 3.2 pp. 40-1] typdef #ifdef, ( MY TYPE DEFINED) typdef : [ISO, Sec , Sec ]; [H&S, Sec p. 225] #if (, ) : [ISO, Sec ]; [H&S, Sec p. 225] 10.16, #ifdef #include #ifdef, unifdef, rmifdef scpp (selective C preprocessor) , gcc -E -dm,, Unix, ( unix ) ( ),
71 10 C , #define Paste(a, b) a/**/b ( Reiser),, ANSI ( K&R ), ANSI ##, 52] #define Paste(a, b) a##b : [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec p #define TRACE(n) printf("trace: %d\n", n) TRACE(count); printf("trace: %d\count", count); #, , C,, make(1) C, Unix m , printf() #define DEBUG(args) (printf("debug: "), printf args) if(n!= 0) DEBUG(("n is %d\n", n)); gcc (DEBUG1, DEBUG2, ), :
72 10 C 52 #define DEBUG(args) (printf("debug: "), printf(args)) #define _, DEBUG("i = %d" _ i); C99... ( ), VA ARGS,, ,, #define printf myprintf : [C9X, Sec , Sec ]
73 11 ANSI/ISO C 11.1 ANSI C 1983, (ANSI) X3J11 C, ANSX ANSI C, C++ ( ) ( ) ANSI C C,, ISO/IEC 9899:1990, ( ANSI/ISO [1992]) X3.159 ISO, 1994, 1 (TC1) 40,, 1 (NA1) 50, 1995, TC2,, C99,, C99 ANSI, (Rational),, (PDF) American National Standards Institute 11 W. 42nd St., 13th floor New York, NY USA (+1) Global Engineering Documents 15 Inverness Way E Englewood, CO USA (+1) (800) (U.S. & Canada),, Geneva ISO, : 53
74 11 ANSI/ISO C 54 ISO Sales Case Postale 56 CH-1211 Geneve 20 Switzerland URL comp.std.internat FAQ, Standards.Faq Herbert Schild ANSI C ISO 9899 ; Osborne/McGraw-Hill, ISBN , 40 :, Clive Feather ( ) ANSI ftp://ftp.uu.net/doc/standards/ansi/ X ftp ( 18.18), lysator.liu.se/c/rat/title.html Silicon Press, ISBN C9X ISO/IEC JTC1/SC22/WG14, ( C9X ): liu.se/c/index.html, dmk.com/ 11.4 ANSI extern int func(float); int func(x) float x; {... extern int func(float); int func(x) float x;, C ( ANSI C),,, : int func(float x) {... } extern int func(double);
75 11 ANSI/ISO C 55,,, (char, short int float) 1.8 : [K&R1, Sec. A7.1 p. 186]; [K&R2, Sec. A7.3.2 p. 202]; [ISO, Sec , Sec ]; [Rationale, Sec , Sec ]; [H&S, Sec. 9.2 pp , Sec. 9.4 pp ] 11.5,, 11.4,, : [ISO, Sec , Sec ]; [H&S, Sec pp , Sec pp ] 11.6 extern int f(struct x *p); x C, ( ),, : struct x; x,, x x : [ISO, Sec , Sec , Sec ] 11.7 : const int n = 5; int a[n]; const ; ( ) const C C++, #define ( enum) : [ISO, Sec. 6.4]; [H&S, Secs , pp ] 11.8,
76 11 ANSI/ISO C 56 char *p = "Hello, world!"; p const char *p char * const p const char *p ( char const *p ), ; char * const p ( ),, ; 1.7 : [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec p. 81] const char ** char ** const-t T ( T ), ( ),, (, (const char **)),, : [ISO, Sec , Sec , Sec ]; [H&S, Sec pp ] main() int main(), int main(void) int main(int argc, char *argv[]) ( argc argv ) : [ISO, Sec , Sec. G.5.1]; [H&S, Sec p. 416]; [CT&P, Sec pp ] main() void, main main() int, exit(), return (, void main(), C ) /
77 11 ANSI/ISO C 57, main() ;, main(),,, : [ISO, , Sec. G.5.1]; [H&S, Sec p. 416]; [CT&P, Sec pp ] main() envp ( ) getenv(), environ ( ) : [ISO, Sec. G.5.1]; [H&S, Sec pp ] main() void, exit() return, / main(), ; main(), ( ) ( ; 11.12), void main(), void main() BC++4.5 void main() ( DEC C V4.1 gcc) void main() C void main() void main(), main(), exit(status) status main(), main() return ; 16.4, main(),
78 11 ANSI/ISO C 58 : [K&R2, Sec. 7.6 pp ]; [ISO, Sec ] ANSI #, #define Str(x) #x #define Xstr(x) Str(x) #define OP plus char *opname = Xstr(OP); opname plus OP ## ( ) : [ISO, Sec , Sec ] warning: macro replacement within a string literal ANSI / #define TRACE(var, fmt) printf("trace: var = fmt\n", var) TRACE(i, %d); printf("trace: i = %d\n", i);, K&R C, # (ANSI ): #define TRACE(var, fmt) \ printf("trace: " #var " = " #fmt "\n", var) : [H&S, Sec p. 51] #ifdef ANSI C, #if, #ifdef #ifndef " C,, /* */ : [ISO, Sec , Sec. 6.1]; [H&S, Sec. 3.2 p. 40]
79 11 ANSI/ISO C #pragma, #pragam, ( ) : ( lint /* NOTREACHED */ ), : [ISO, Sec ]; [H&S, Sec. 3.7 p. 61] #pragma once ; 10.5 #ifndef, a[3] = "abc";, ANSI C ( ANSI ) 3, a, b c, \0 C strcpy, printf %s,, abc, 4 : [ISO, Sec ]; [H&S, Sec p. 98] void*, char *, 4.3 : [ISO, Sec , Sec ]; [H&S, Sec p. 204] memcpy() memmove(), memmove() memcpy(),, memmove() : [K&R2, Sec. B3 p. 250]; [ISO, Sec , Sec ]; [Rationale, Sec ]; [H&S, Sec pp ]; [PCS, Sec. 11 pp ] malloc(0) 0 ANSI/ISO ; : [ISO, Sec ]; [PCS, Sec p. 386]
80 11 ANSI/ISO C ANSI ANSI/ISO C ANSI 6, C99 31 : [ISO, Sec , Sec ]; [Rationale, Sec ]; [C9X, Sec ]; [H&S, Sec. 2.5 pp. 22-3] ANSI, 1.11, 10.8, ASNI/ISO ANSI ANSI, ANSI,, gcc 11.28, C ANSI C, protoize unprotoize C ANSI C FSF GNU C ; 18.3 GNU GhostScript ansi2knr ANSI C, ANSI C K&R C ; , lint comp. sources.misc CPROTO cextract ; ANSI Frobozz Magic C ANSI, gcc, gcc ;, 11.35
81 11 ANSI/ISO C (implementation-defin-ed) (unspecified) (undefined) : ;, ( ),, ; 3.2,,, (locale-specific) : [ISO, Sec. 3.10, Sec. 3.16, Sec. 3.17]; [Rationale, Sec. 1.6] 11.33,, :, : [ISO, Sec.]; [Rationale, Sec. 1.7] 11.34, ANSI, C,,,,,, : [Rationale, Sec. 1.1]
82 11 ANSI/ISO C i = i++, ANSI,,,, 7.4, 11.31,
83 char c; while((c = getchar())!= EOF)..., getchar int getchar(), EOF getchar char, EOF, EOF ( char ), : [K&R1, Sec. 1.5 p. 14]; [K&R2, Sec p. 16]; [ISO, Sec , Sec , Sec ]; [H&S, Sec p. 116, Sec. 15.1, Sec. 15.6]; [CT&P, Sec. 5.1 p. 70]; [PCS, Sec. 11 p. 157] 12.2 EOF, EOF, C EOF,, Control-D Control-Z 12.3 while(!feof(infp)) { fgets(buf, MAXLINE, infp); fputs(buf, outfp); } C,, C I/O Pascal,, fgets() NULL,, feof() : [K&R2, Sec. 7.6 p. 164]; [ISO, Sec , Sec , Sec ]; [H&S, Sec p. 382] 12.4, fflush(stdout), 63
84 12 64 \n fflush, stdout : [ISO, Sec ] printf % \%, : %% \%, \, printf : [K&R1, Sec. 7.3 p. 147]; [K&R2, Sec. 7.2 p. 154]; [ISO, Sec ] 12.7 printf %lf, scanf() %lf, printf() %f printf %f, printf,, printf() printf() %Lf, : [K&R1, Sec. 7.3 pp , Sec. 7.4 pp ]; [K&R2, Sec. 7.2 pp , Sec. 7.4 pp ]; [ISO, Sec , Sec ]; [H&S, Sec pp , Sec pp ]; [CT&P, Sec. A.1 pp ] 12.8 size t, long, printf, printf,, printf("%lu", (unsigned long)sizeof(thetype)); 12.9 printf, %8d printf("%*d", width, x) 12.14
85 12 65 : [K&R1, Sec. 7.3]; [K&R2, Sec. 7.2]; [ISO, Sec ]; [H&S, Sec ]; [CT&P, Sec. A.1] <locale.h>, printf() locale : [ISO, Sec. 7.4]; [H&S, Sec pp ] scanf("%d", i) scanf() scanf("%d", &i) char s[30]; scanf("%s", s); & ; & scanf(), &, &, double d; scanf("%f", &d); 12.7 printf(), scanf() %lf, %f scanf() : scanf() ANSI, scanf %d\n scanf,, \n scanf, : [K&R2, Sec. B1.3 pp ]; [ISO, Sec ]; [H&S, Sec pp ]
86 scanf %d, gets(), gets() scanf %d, gets(), scanf() gets(), ; scanf scanf(), : [ISO, Sec ]; [H&S, Sec pp ] 12.17, scanf(), scanf(),,, scanf(): scanf() scanf %d %f x, scanf() x : [ISO, Sec ]; [H&S, Sec pp ] scanf() scanf() 12.15, , %s gets() ( 12.20), scanf(),, scan formatted,,,, scanf() ; fgets(), sscanf() strtol(), strtok() atoi() ; 13.4 scanf,, %s, : [K&R2, Sec. 7.4 p. 159] sprintf sprintf() sprintf(), %s, strlen(), %d
87 12 67 ((sizeof(int) * CHAR_BIT + 2) / 3 + 1) /* +1 for - */ CHAR BIT <limits.h>, ;, sprintf,, fprintf(), fprintf, 19.14,, sprintf(),, %.Ns %s, %.*s, 12.9, sprintf(), snprintf() snprintf(buf, bufsize, "You typed \"%s\"", answer); snprintf() stdio, GNU 4.4bsd C99, C99 snprintf() sprintf() C99 snprintf(), 0 nch = snprintf(null, 0, fmtstring, /* */ ); ( ) asprintf(), bsd GNU C, malloc, : char *buf; asprintf(&buf, "%d = %s", 42, "forty-two"); /*, buf malloc */ : [C9X, Sec ] gets() fgets(), gets(), fgets() gets(),,, 7.1 fgets() gets() : [Rationale, Sec ]; [H&S, Sec p. 356] printf() errno ENOTTY stdout, stdio, stdout
88 12 68, errno ENOTTY, errno errno 0 : [ISO, Sec , Sec ]; [CT&P, Sec. 5.4 p. 73]; [PCS, Sec. 14 p. 254] fgetops/fsetops ftell/fseek fgetops() fsetops() ftell() fseek() ( ),, 20 (2 31 1) fgetpos() fsetpos() fpos t,, fgetpos() fsetpos fgetpos() gsetpos() 1.2 : [K&R2, Sec. B1.6 p. 248]; [ISO, Sec , Secs , ]; [H&S, Sec p. 252] 12.23, fflush(stdin) fflush() flush, fflush : [ISO, Sec ]; [H&S, Sec. 15.2] fflush(), scanf() ( ), scanf(), while((c = getchar())!= \n && c!= EOF) /* */ ; curses flushinp(),,, ( ), ; : [ISO, Sec ]; [H&S, Sec. 15.2] fopen()
89 r+,,, fseek,, + fseek fflush,,, : [ISO, Sec ] stdin stdout freopen(), freopen(), stdout ( stdin), freopen() ( ), ( ), freopen(), dup(), dup2() FILE, 12.29, printf, : #include <stdio.h> #include <stdarg.h> void f2printf(file *fp1, FILE *fp2, char *fmt,...) { va_list argp; va_start(argp, fmt); vfprintf(fp1, fmt, argp); va_end(argp); va_start(argp, fmt); vfprintf(fp2, fmt, argp); va_end(argp); } f2printf() fprintf(), 15.5
90 x0a 0x0d, 0x1a, EOF rb fopen(),,, wb / :, I/O : [ISO, Sec ]; [H&S, Sec p. 348]
91 ( atoi ) itoa() sprintf() sprintf(), ; 7.6 ; sprintf() ( %ld %f) : [K&R1, Sec. 3.6 p. 60]; [K&R2, Sec. 3.6 p. 64] 13.2 strncpy() \0 strncpy(), \0 strncpy \0, strncpy(), \0 strncat strncpy : (, *dest = \0 ), strncat() strncpy() sprintf(dest, "%.*s", n, source) ( ), memcpy() strncpy() 13.3 toupper() toupper() tolower() toupper() tolower(), ANSI/ISO C, : [ISO, Sec ]; [H&S, Sec pp ]; [PCS, p. 182] 71
92 main() argc argv strtok(),,, : [K&R2, Sec. B3 p. 250]; [ISO, Sec ]; [H&S, Sec pp ]; [PCS, p. 178] 13.5 Unix ed grep,,,, <regex.h> <regexp.h> regcmp/regex, regcomp/regexec, re comp/re exec regexp ftp://ftp.cs.toronto.edu/pub/regexp.shar.z Henry Spencer regexp, GNU rx ( globbing ) Unix, shell,, MS-DOS, argv ( MS-DOS VMS) strcmp(), qsort(), qsort,, strcmp(), strcmp() : /* */ int pstrcmp(const void *p1, const void *p2) { return strcmp(*(char * const *)p1, *(char * const *)p2); } const void *, ( ),, strcmp() char* qsort [K&R2] , : [ISO, Sec ]; [H&S, Sec p. 419]
93 qsort(), qsort(), (const void*), 13.6 : int mystructcmp(const void *p1, const void *p2) { const struct mystruct *sp1 = p1; const struct mystruct *sp2 = p2; /* sp1->whatever sp2->... */ mystruct sp1 = p1 sp2 = p2 ; p1 p2 void,,, 13.6, sp1 = *(struct mystruct * const *)p1,,, 4.5 : [ISO, Sec ]; [H&S, Sec p. 419] 13.8,, ( ),,, qsort(), : [Knuth, Sec pp , Sec pp ]; [Sedgewick, Sec. 8 pp , Sec. 12 pp ] 13.9, [Knuth],,,, : : [Knuth, Sec. 5.4 pp ]; [Sedgewick, Sec. 13 pp ] C time(), ctime(), localtime() / strftime() :
94 13 74 #include <stdio.h> #include <time.h> int main() { time_t now; time(&now); printf("it s %s", ctime(&now)); return 0; } strftime(), : [K&R2, Sec. B10 pp ]; [ISO, Sec. 7.12]; [H&S, Sec. 18] localtime() time t struct tm, ctime() time t, struct tm time t ANSI C mktime(), struct tm time t time t, strptime(), strftime() partime() ( RCS ) getdate() (, C ) : [K&R2, Sec. B10 p. 256]; [ISO, Sec ]; [H&S, Sec pp ] N ANSI/ISO C mktime() difftime() mktime(), struct tm, tm mday, mktime(), time t mktime() time t, difftime() time t, time t time t, ; time t Unix Posix tm mday int, 32,736,, 24, Julian, Julian : Snippets ( 18.16); Simtel/Oakland ( JULCAL10.ZIP, 18.18) Date conversions [Burki]
95 , : [K&R2, Sec. B10 p. 256]; [ISO, Secs , ]; [H&S, Secs. 18.4,18.5 pp ]; [Burki] C : rand(),, ; sci.math.num-analysis FAQ : r250, RANLIB FSULTRA ( 18.18), Marsaglia, Matumoto Nishimura Mersenne Twister, Don Knuth : [K&R2, Sec. 2.7 p. 46, Sec p. 168]; [ISO, Sec ]; [H&S, Sec p. 393]; [PCS, Sec. 11 p. 172]; [Knuth, Vol. 2 Chap. 3 pp ]; [P&M] rand() % N /* */ 0 N 1,, : (int)((double)rand() / ((double)rand_max + 1) * N), : rand() / (RAND_MAX / N + 1) RAND MAX, N RAND MAX RAND MAX ANSI #define <stdlib.h>, RAND MAX, C rand() RAND MAX, rand() 0 1, 0 N 1, N : [K&R2, Sec p. 168]; [PCS, PCS Sec. 11 p. 172] 13.15, rand() srand(),, :
96 13 76 #include <stdlib.h> #include <time.h> srand((unsigned int)time((time_t *)NULL));,, time() time t,, : 19.36, srand() ; rand() srand() : [K&R2, Sec p. 168]; [ISO, Sec ]; [H&S, Sec p. 393] /, rand() % 2, 0, 1, 0, 1, 0,, ; : [Knuth, Sec pp ] Marsaglia Knuth : #include <stdlib.h> #include <math.h> double gaussrand() { static double V1, V2, S; static int phase = 0; double X; if(phase == 0) { do { double U1 = (double)rand() / RAND_MAX; double U2 = (double)rand() / RAND_MAX; V1 = 2 * U1-1; V2 = 2 * U2-1; S = V1 * V1 + V2 * V2; } while(s >= 1 S == 0); X = V1 * sqrt(-2 * log(s) / S); } else X = V2 * sqrt(-2 * log(s) / S);
97 13 77 phase = 1 - phase; return X; }, : [Knuth, Sec p. 117]; [Marsaglia&Bray]; [Press et al., Sec. 7.2 pp ] 13.18, #inlude,,,, #include 10.10, 11.29, 13.19, ,, ( ) ;,, Unix, -l end Unix, end,, end printf, C printf(), printf()
98 13 78
99 float 3.1, printf , 0.1, ,,,. /, printf , #include <math.h>, double atof(), <stdlib.h> 14.3 : [CT&P, Sec. 4.5 pp. 65-6] 14.3, #include <math.h>, undefined: sin ( sin ) (math library), Unix Linux, bug, -lm 13.18, , 14.2.,,,,, ;
100 14 80 C, (CPU) ( 11.34),, : [K&P, Sec. 6 pp ]; [Knuth, Volume 2 chapter 4]; [Goldberg] 14.5, double a, b;... if (a == b) /* */ #include <math.h> if (fabs(a - b) <= epsilon * fabs(a)) epsilon a 0 : [Knuth, Sec pp ] 14.6 (int)(x + 0.5) (int)(x < 0? x : x + 0.5) 14.7 C C pow(), <math.h>, 14.8 <math.h> M PI, π π,, 4*atan(1.0) acos(-1.0) : [PCS, Sec. 13 p. 237]
101 IEEE NaN IEEE, <math.h>, <ieee.h> <nan.h>, isnan() NaN #define isnan(x) ((x)!= (x)) IEEE C99 isnan(), fpclassify(), sprintf(),, NaN Inf : [C9X, Sec ] C, C99 2.8, : [C9X, Sec , Sec. 7.8] (FFT) ( ) Ajay Shah URL ftp://ftp.math.psu.edu/pub/faq/numcomp-free-c 18.8, , Turbo C, floating point formats not linked ( ), Turbo C ( Richie PDP-11 ), printf() scanf(), %e %f %g, Borland, ( sqrt(), ) comp.os.msdos.programmer FAQ
102 14 82
103 printf(), #include <stdio.h> printf(),,,,... : [ISO, Sec , Sec ]; [Rationale, Sec , Sec ]; [H&S, Sec pp , Sec. 9.6 pp ] 15.2 %f printf(), float double : char short int int, float double,, 11.4 printf %f double, %c int, %hd 12.7, : [ISO, Sec ]; [H&S, Sec p. 177, Sec. 9.4 pp ] 15.3 n long int, printf("%d", n); ANSI, 1 5.2, 11.4, <stdarg.h> 1 : ( gcc),, (printf, scanf... ), gcc -Wall, : warning: int format, long int arg (arg 2) 83
104 15 84, malloc #include <stdlib.h> /* malloc, NULL, size_t */ #include <stdarg.h> /* va_ */ #include <string.h> /* strcat */ char *vstrcat(const char *first,...) { size_t len; char *retbuf; va_list argp; char *p; if(first == NULL) return NULL; len = strlen(first); va_start(argp, first); while((p = va_arg(argp, char *))!= NULL) len += strlen(p); va_end(argp); retbuf = malloc(len + 1); /* +1 \0 */ if(retbuf == NULL) return NULL; /* */ (void)strcpy(retbuf, first); va_start(argp, first); /* */ while((p = va_arg(argp, char *))!= NULL) (void)strcat(retbuf, p); va_end(argp); return retbuf; } : char *str = vstrcat("hello, ", "world!", (char *)NULL); ; 5.2, 15.3, malloc : [K&R2, Sec. 7.3 p. 155, Sec. B7 p. 254]; [ISO, Sec. 7.8]; [Rationale, Sec. 4.8]; [H&S, Sec pp ]; [CT&P, Sec. A.3 pp ]; [PCS, Sec. 11 pp , Sec. 13 p. 242]
105 printf(), printf() vprintf(), vfprintf() vsprintf() error(),, error: #include <stdio.h> #include <stdarg.h> void error(const char *fmt,...) { va_list argp; fprintf(stderr, "error: "); va_start(argp, fmt); vfprintf(stderr, fmt, argp); va_end(argp); fprintf(stderr, "\n"); } : [K&R2, Sec. 8.3 p. 174, Sec. B1.2 p. 245]; [ISO, Secs , , ]; [H&S, Sec pp ]; [PCS, Sec. 11 pp ] 15.6 scanf(), scanf() C99 vscanf(), vfscanf() vsscanf(), C99 : [C9X, Secs ] 15.7 nargs(),, printf, %d,,, 0-1, exec1() vstrcat(),, : [PCS, Sec. 11 pp ]
106 C, va start() 263] int f(...) {... } 15.9 : [ISO, Sec , Sec , Sec ]; [H&S, Sec. 9.2 p float, va arg(argp, float) : float ( ) double, char short int int va arg(arpg, float) va arg(arpg, double), va arg(argp, int) char, short int, va start() : [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec p. 297] va arg() va arg() typedef, 1.7 : [ISO, Sec ]; [Rationale, Sec ] 15.11,,,, va list vfprintf(), 15.5, va list, 15.12
107 , (Steve Summit),, (void *),, main() argv 19.35
108 15 88
109 ,, #if/#ifdef/#ifndef/#else/#endif, 2.14, myprocedure; /* */ C,, : myprocedure(); 16.3,, main() ( ),,,, malloc(), , 16.4, , main() main(), 2.14, 10.8, setbuf() setvbuf() atexit() : [CT&P, Sec. 5.3 pp. 72-3] 89
110 ,,, :, 7.1, 16,, a * b / c, 3.11, , int, 1.8, , 5 malloc/free : malloc malloc, , 16.7 printf(), %d long int, 12.7 unsigned int,, ,, sprinf(), typedef, size t, lint 16.3, : char *p = "hello, worl!"; p[0] = H ;, : char a[] = "hello, world!"; 1.13 : [ISO, Sec ]; [H&S, Sec pp. 31-2]
111 Segmentation violation, Bus error General protection fault,, : ( );, ( ) ( ); malloc ( 7.16);,, scanf() ( 12.11) fprintf() ( FILE *)
112 16 92
113 C K&R, :,,, ( ),, K&R, (Indian Hill Style Guide), 17.7, 10.4 : [K&R1, Sec. 1.2 p. 10]; [K&R2, Sec. 1.2 p. 10] 17.2 if(!strcmp(s1, s2)),,,,! ( ),, : #define Streq(s1, s2) (strcmp((s1), (s2)) == 0) if (0 == x) if (x == 0) : if (x = 0) ==, : if (0 = x), = : [H&S, Sec pp ] 93
114 extern int func ((int, int));, ANSI,, #ifdef STDC #define (proto) proto #else #define (proto) () #endif 17.5 printf(), (void) printf(), lint, (void) :, ( ), strcpy() strcat(), : [K&R2, Sec. A6.7 p. 199]; [Rationale, Sec ]; [H&S, Sec p. 172, Sec pp ] 17.6 (Hungarian Notation), Charles Simonyi ( ),,, : [Simonyi&Heller] 17.7 (Indian Hill Style Guide) ftp ftp.cs.washington.edu ftp.cs.toronto.edu ftp.cs.umd.edu pub/cstyle.tar.z (, (Indian Hill Guide)) doc/programming ( Henry Spencer C ( 10 Commandments for C Programmers )) pub/style-guide
115 17 95 : The Elements of Programming Style [K&P], Plum Hall Programming Guidelines [Plum], C Style: Standards and Guidelines [Straker] [21] goto,,,, goto,,, goto, goto, goto, goto,,,, ( 5.3, 5.7, ),,
116 17 96
117 18 URL,, 18.1 ( 18.18) C cflow, cxref, calls, cscope, xscope, ixfw C / cb, indent, GNU indent, vgrind CVS, RCS, SCCS C ( ) obfus, shroud, opqcp make makedepend, cc -M cpp -M ccount, Metre, lcount, csize; McCable and Associates C UNIX wc, grep -c ";" C (cdecl) comp.sources.unix 14 ( 18.18) [K&R2] malloc 18.2 C C (lint) 18.5 C 18.3,, Usenet comp.compilers comp.software-eng
118 malloc malloc Conor P. Cahill dbmalloc, comp.sources.misc leak comp.sources.unix 27 ; Snippets JMalloc.c, JMalloc.h; MEMDEBUG (ftp://ftp.crpht.lu/pub/sources/memdebug); Electric Fence 18.18, malloc : CodeCenter (Saber-C) from Centerline Software ( Insight (now Insure?), from ParaSoft Corporation ( com/) Purify, from Rational Software ( Pure Software, IBM ) ZeroFault, from The ZeroFault Group ( GNU C ( C. djgpp ( MS-DOS GCC, Macs Windwos GCC 1 lcc lcc-win32/, http: // Power C Mix Sotfware MS-DOS 1132 Commerce Drive, Richardson, TX 75801, USA, ftp://ftp.hitech.com.au/hitech/pacific MS-DOS C comp.compilers FAQ , lint ( -a, -c, -h, -p ) C, 1 : Windows cygwin ( MinGW (http: //
119 ANSI lint PC-Lint FlexeLint Gimpel Software ( com/) Unix System V 4 lint ANSI UNIX Support Labs System V ( C ) ANSI lint Splint ( lclint, lint, lint gcc -Wall -pedantic 18.6 ANSI lint,, lint,, lint lint, C : Tom Torfs Christopher Sawtell C (Notes for C programmers) : ftp://svr-ftp.eng.cam.ac.uk/misc/sawtell C. shar, ftp://garbo.uwasa.fi/pc/c-lang/c-lesson.zip, Teori/KURS/OTHER/newzealand.html Time Love C (C for Programmers) ac.uk/help/tpl/languages/c/teaching C/ The Coronado Enterprises C tutorials Simtel pub/msdos/c, Steve Holmes Martin Brown C computing/c/welcome.html UNIX, shell, learn c
120 18 100, FAQ C, scs/cclass/cclass.html :,,,,,, C, liu.se/c/index.html Vinit Carpenter C C++, comp.lang.c comp.lang.c++, FAQ ( 20.36), , ftp://garbo.uwasa.fi/pc/c-lang/00index.txt, http: // scs/src/,,, 18.7, 18.10, C C,,, Kernighan Richie The C programming Language ( K&R, [K&R2]) ; C, ;,,, : jamie/.refs/.footnotes/c-annotes.html, scs/cclass/ cclass.html, comp.lang.c K.N. King C: A Modern Approach Samuel P. Harbison Guy L. Steele C: A Reference Manual [H&S] C, FAQ, [CFAQ] C C++ (Association of C and C++, ACCU) C/C++ ( 18.7
121 C GNU C ( P.J. Plauger The Standard C Library [Plauger], 18.8, C : c/ index.html, cl/index.html ANSI/ISO C : defunc, comp.sources. misc (V41 i32,33), alt.sources URL : ftp://sunsite.unc.edu/pub/packages/development/libraries/defunc-1.3.tar. Z; parse, lamont.ldgo.columbia.edu S-Lang (ftp://amy.tch.harvard.edu/pub/slang), Cmm ( C C ) C BNF YACC ANSI Jim Roskind ftp://ftp. eskimo.com/u/s/scs/roskind grammar.z ANSI C90 ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.z, lexer FSF GNU C, K&R comp.compilers, 18.3 : [K&R1, Sec. A18 pp ]; [K&R2, Sec. A13 pp ]; [ISO, Sec. B.2]; [H&S, pp Appendix B] C Plum Hall ( Cardiff, NJ, Hawaii) ; Ronald Guilmette RoadTest TM ( ftp://netcom.com/pub/ rfg/roadtest/announce.txt); Nullstone (
122 nullstone.com) FSF GNU C (gcc) C Kahan (ftp://netlib.att.com/netlib/paranoia), C Bob Stout SNIPPETS (ftp://ftp.brokersys.com/pub/ snippets Lars Wirzenius publib (ftp://ftp.funet.fi/pub/languages/c/publib/) 14.11, 18.7, 18.8, : quad, BSD Unix libc (ftp.uu.net, /systems/unix/bsd-sources/.../src/lib/libc/quad/*); GNU MP libmp ; MIRACL ( mscott/); David Bell Landon Curt Noll calc ; Unix libmp.a ,,, : ftp.uu.net, archive.umich.edu, oak. oakland.edu, sumex-aim.stanford.edu wuarchive.wustl.edu FSF GNU ftp.gnu.org,, ftp ftp, ftp-by-mail, (WWW),, archie,, Alta Vista, Excite Yahoo Usenet, comp.sources.unix comp.sources.misc, : ftp://gatekeeper.dec.com/pub/usenet/comp.sources.unix/, ftp://ftp.uu. net/usenet/comp.sources.unix/ comp.archives
123 ftp,, FAQ How to find sources ( ) 14.11, 18.8,
124 18 104
125 RETURN, C,, ( ),,, RETURN, ( getchar() ),,, ( getchar() ),, ( MS-DOS, VMS ), ( Unix, VMS ), ( ),, ( read(), getchar() ), ( ),, ( ),, comp.lang.c C,, comp.unix.questions comp.os.msdos.programmer,, Unix,,,, curses cbreak(), noecho() getch(),, getpass() Unix, ioctl(), 105
126 CBREAK RAW, System V POSIX ICANON, c cc[vmin] c cc[vtime], ECHO, system() stty,, <sgtty.h> tty(4), System V, <termio.h> termio(4), POSIX, <termios.h> termios(4) MS-DOS, getch() getche(), BIOS VMS, (SMG$), curses, $QIO IO$ READVBLK, IO$M NOECHO VMS,,, setbuf() setvbuf() sdtin,, 1), ( ), 2), 3),, ( 20.36) 19.2 : [PCS, Sec. 10 pp , Sec pp ]; [POSIX, Sec. 7] 19.2,,, curses nodelay(),, select poll, ioctl FIONREAD, c cc[vtime], kbhit(), rdchk(), open() fcntl() O NDELAY , \r, \b, fflush() : [ISO, Sec ] 19.4 ( ) termcap, terminfo curses, MS-DOS, clrscr() gotoxy()
127 : ( \f ), ( ), : system() ( 19.30) [PCS, Sec pp , Sec pp ] 19.5, terminfo, termcap, curses ASCII, ( ESC [ \033 ] ) keypad(), curses MS-DOS,, 0 ( 0 ), DOS : 72, 80, 75, 77, : [PCS, Sec pp. 56-7] 19.6,, FAQ X Windown, MD-DOS, Macintosh, [PCS, Sec. 5.5 pp ] 19.7 ( comm ) Unix, /dev, ( ) MS-DOS, stdaux, COM1, BIOS,, Joe Campbell C ( C Programmer s Guide to Serial Communications ) 19.8 Unix, popen() ( 19.31) lp lpr, /dev/lp MS-DOS, stdprn ( ), PRN LPT1, ( ), : [PCS, Sec. 5.3 pp ]
128 ( 19.8), ASCII, 033 ( 27), ESC[J: fprintf(ofd, "\033[J"); 19.10, :, inport outport ( ), (memory-mapped I/O) , Unix (plot(3) plot(5)) Robert Maier GNU libplot, ( OpenGL, GKS PHIGS MS-DOS, VESA BGI,, C, (Macintosh, X Window, Microsoft Windows),, FAQ : [PCS, Sec. 5.4 pp ] GIF JPEG, ijg.org/files/ JPEG 19.13, ( ), stat(), access() fopen() fopen(),,,,
129 fopen(), access, Unix UID,,,,,, O EXCL, [PCS, Sec. 12 pp. 189,213]; [POSIX, ec , Sec , Sec ] 19.14, C, Unix stat() Unix stat(), fseek(), ftell(), fstat(), : fstat(), stat() ; ftell(),,,, fseek SEEK END filesize() filelength(), C,, : [ISO, Sec ]; [H&S, Sec ]; [PCS, Sec. 12 p. 213]; [POSIX, Sec ] Unix POSIX stat(), BSD ftruncate(), chsize(), fcntl F FREESP MS-DOS, write(fd, "", 0),, ( ),,,
130 , Unix,,, (pipe) (, ),, ( fopen() ) C remove() ANSI Unix, remove(), unlink() [K&R2, Sec. B1.1 p. 242; ISO Sec ]; [H&S, Sec p. 382]; [PCS, Sec. 12 pp. 208, ]; [POSIX, Sec , Sec ] system(), ( fopen() ),, : [K&R2, Sec. 1, Sec. 7] fopen("c:\ newdir \file.dat", "r") \n \f,,, \, fopen() ( ),, : fopen("c:\\newdir\\file.dat", "r"), MS-DOS,, fopen("c:/newdir/file.dat", "r"),, #include,
131 fopen() : "$HOME/.profile" " /.myrcfile" Unix, $HOME shell fopen() MS-DOS Abort, Retry, Ignore?, DOS, 24H comp.os.msdos.programmer FAQ Too many open files (, : ; stdio FILE MS-DOS, CONFIG.SYS, handle stdio FILE ( ) C opendir() readdir(), POSIX, Unix MS-DOS, VMS MS- DOS FINDFIRST FINDNEXT,, MS Windows FindFirstFile FindNextFile readdir(),, stat(), 13.5 : cite[sec. 8.6 pp ]kr2; [PCS, Sec. 13 pp ]; [POSIX, Sec. 5.1]; [Schumacher, ed., Sec. 8] 19.26, K,,,
132 K, C 32K, C99 64K,,,, 6.13 PC ( 8086), 64K 640K, huge ( ),, malloc halloc() farmalloc(), 32 ( djgpp, 18.3), DOS, : [ISO, Sec ]; [C9X, Sec ] DGROUP data allocation exceeds 64K (DGROUP 64K), 64K, MS-DOS (, ),, ( ),,,, Microsoft /Gt ( ),, : unsigned int *magicloc = (unsigned int *)0x ;, *magiloc, volatile MS-DOS,, MK FP : [K&R1, Sec. A14.4 p. 210]; [K&R2, Sec. A6.6 p. 199]; [ISO, Sec ;]; [Rationale, Sec ]; [H&S, Sec pp ] C (, ) system(),, ( ),, system(), sprintf()
133 19 113,, exec spawn ( execl, execv, spawnl, spawnv ) : [K&R1, Sec. 7.9 p. 157]; [K&R2, Sec p. 167, Sec. B6 p. 253]; [ISO, Sec ]; [H&S, Sec p. 407]; [PCS, Sec. 11 p. 179] 19.31, Unix popen(), stdio, ( ),, pclose() popen(), system(), Unix, popen(), pipe(), dup(), fork() exec() : [PCS, Sec. 11 p. 169] arg[0], arg[0],, : [K&R1, Sec p. 111]; [K&R2, Sec p. 115]; [ISO, Sec ]; [H&S, Sec p. 416.] , ( ),,, Unix /,,, Unix, ( setenv() putenv() ),, MS-DOS,, MS-DOS FAQ
134 malloc,, BSD Unix, system() ld -A SunOS System V -ldl, VMS, LIB$FIND IMAGE SYMBOL GNU dld , : clock(), delay(), ftime(), getimeofday(), msleep(), nap(), napms(), nanaosleep(), setitimer(), sleep(), Sleep(), times() usleep Unix, wait() select() poll() ( ) MS-DOS,, clock() ANSI clock(), CLOCKS PER SEC 1,, clock(),,,,,,,, sleep(), select() poll() alarm() setitimer(), : long int i; for (i = 0; i < ; ++i) ;,,, : [H&S, Sec pp ]; [PCS, Sec. 12 pp ,215-6]; [POSIX, Sec ] control-c signal() #include <signal.h> singal(sigint, SIG_IGN);, : extern void func(int); signal(sigint, func);
135 19 115, func() ( Unix), extern void func(int); if(signal(sigint, SIG_IGN)!= SIG_IGN) signal(sigint, func);, signal,, 19.1,,, ( ) MS-DOS, setcbrk() ctrlbrk() : [ISO, Secs. 7.7,7.7.1]; [H&S, Sec pp ]; [PCS, Sec. 12 pp ]; [POSIX, Secs ,3.3.4] 19.38, matherr(), ( <math> ), signal() ( 19.37) SIGFPE 14.9 : [Rationale, Sec ] socket /, C : Douglas Comer Internetworking with TCP/IP W. R. Stevens UNIX Network Programming, Unix Socket FAQ ( sock-faq/), Beej s Guide to Network Programming ( edu/ beej/guide/net/) :, -lsocket -lnsl ; BIOS ISR TSR ( MS-DOS PC ) comp.os.msdos.programmer FAQ ; Ralf Brown 19.41, union REGS int86() MS-DOS
136 near far, ;, DOS Windows 19.43, ANSI!, ANSI/ISO C ;, POSIX (IEEE , ISO/IEC ), ( Unix) POSIX, ANSI, #ifdef
137 ,,, main(), argv 8.2, : [K&R1, Sec pp ]; [K&R2, Sec pp ]; [ISO, Sec ]; [H&S, Sec p. 416]; [PCS, Sec. 5.6 pp. 81-2, Sec. 11 p. 159, pp Appendix F]; [Schumacher, ed., Sec. 4 pp ] 20.3, ( ASCII), fprintf(), fscanf(),,,,,, I/O Sun XDR (RFC 1014) OSI ASN.1 ( CCITT X.409 ISO 8825 Basic Encoding Rules ) CDF netcdf HDF : [PCS, Sec. 6 pp. 86, 88] 20.4 char * int one_func(), two_func(); int red_func(), blue_func(); struct { char *name; int (*funcptr)(); } symtab[] = { "one_func", one_func, 117
138 "two_func", two_func, "red_func", red_func, "blue_func",blue_func, };, 2.13, : [PCS, Sec. 11 p. 168] 20.5 int char,, char #include <limits.h> /* for CHAR_BIT */ #define BITMASK(b) (1 << ((b) % CHAR_BIT)) #define BITSLOT(b) ((b) / CHAR_BIT) #define BITSET(a, b) ((a)[bitslot(b)] = BITMASK(b)) #define BITTEST(a, b) ((a)[bitslot(b)] & BITMASK(b)) <limits.h>, CHAR BIT 8 : [H&S, Sec pp ] 20.6 int x = 1; if(*(char *)&x == 1) printf("little-endian\n"); else printf("big-endian\n"); : [H&S, Sec pp ] 20.7 V7 Unix swap(),, ; 20.6 ( BSD ntohs() ), ( ),,,, 20.6 : [PCS, Sec. 11 p. 179]
139 ,,,, 0 0x ( ) I/O, printf scanf, (%d, %o %x ); strtol() strtoul(),, ( strtol ) I/O, I/O, : [ISO, Secs , ] 20.9 printf() 20.8 strtol() ) ( 20.11,,,,,,,,,,,,, profiling, ( I/O ),,, (, ),,,, ;
140 20 120,,, Kernighan Plauger The Elements of Programming Style [K&P], Jon Bentley Writing Efficient Programs [Bentley] i i = i +1,,,,,,,,,,,, i = i + 1,, ++i, i += 1 i = i + 1,, ,, i/=2 i, ( : i ), a ^= b; b ^= a; a ^= b;, : int t = a; a = b; b = t;, ( EXCH ), XOR
141 ,,, strcmp() if/else 10.11, : [K&R1, Sec. 3.4 p. 55]; [K&R2, Sec. 3.4 p. 58]; [ISO, Sec ]; [H&S, Sec. 8.7 p. 248] case ( ) switch, case, case,, if/else : [K&R1, Sec. 3.4 p. 55]; [K&R2, Sec. 3.4 p. 58]; [ISO, Sec ]; [Rationale, Sec ]; [H&S, Sec. 8.7 p. 248] return, C,, C,,,, sizeof : [K&R1, Sec. A18.3 p. 218]; [ISO, Sec , Sec ]; [H&S, Sec. 8.9 p. 254.] C C PL/I, C, #ifdef #if 0, ( 11.20) /* */,, ( C ) // C99 : [K&R1, Sec. A2.1 p. 179]; [K&R2, Sec. A2.2 p. 192]; [ISO, Sec , Annex F; Rationale Sec ]; [H&S, Sec. 2.2 pp. 18-9]; [PCS, Sec. 10 p. 130]
142 C a+++++b C,,,, : a b : [K&R1, Sec. A2 p. 179]; [K&R2, Sec. A2.1 p. 192]; [ISO, Sec. 6.1]; [H&S, Sec. 2.3 pp ] C,,, gcc ( qsort ), (static),,, qsort assert() <assert.h>,,,,, : assert(p!= NULL);, malloc() fopen() : [K&R2, Sec. B6 pp ]; [ISO, Sec. 7.2]; [H&S, Sec p. 406] C FORTRAN (C++, BASIC, Pascal, Ada, LISP),,, FORTRAN, Glenn Geers FORT.gz, ftp suphys.physics.su.oz.au src Burkhard Burow cfortran.h C/FORTRAN ftp zebra.desy.de burow
143 C++, C C : [H&S, Sec pp ] Pascal Fortran ( LISP, Ada, awk, C) C : p2c Dave Gillespie Pascal C, comp.sources. unix 1990 ( 21 ); ftp://csvax.cs.caltech.edu/pub/p2c tar.Z ptoc Pascal C, Pascal (comp.sources.unix, 10, 13 ) f2c Fortran C, Bell Labs, Bellcore Carnegie Mellon f2c : send index from f2c [email protected] research!netlib ( ftp netlib.att.com netlib/f2c ) FAQ C++ C C++ C C++ C, C, C C++, ANSI C C++,,, C C++, C C++, C C++ ; : [H&S, p. xviii, Sec p. 6, Sec. 2.8 pp. 36-7, Sec. 4.9 pp ] strcmp,, Sun Wu Udi Manber AGREP A Fast Approximate Pattern- Matching Tool [AGREP], soundex, ( ),
144 : [Knuth, Sec. 6 pp Volume 3]; [AGREP] 20.26, ( ) ( ),, ; : [K&R2, Sec. 6.6]; [Knuth, Sec. 6.4 pp Volume 3]; [Sedgewick, Sec. 16 pp ] 20.27, mktime() localtime() ( , tm hour 0, DST ( ) ); Zeller congruence ( sci.math FAQ); Tomohiko Sakamoto : int dayofweek(int y, int m, int d) /* 0 = Sunday */ { static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; y -= m < 3; return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7; } : [ISO, Sec ] (year%4 == 0) 2000 (2000 ), year % 4 == 0 && (year % 100!= 0 year % 400 == 0) ; :, (, ): char*s="char*s=%c%s%c;main(){printf(s,34,s,34);}"; main(){printf(s,34,s,34);}
145 20 125, #include <stdio.h>, " 34, ASCII James Hu #define q(k)main(){return!puts(#k"\nq("#k")");} q(#define q(k)main(){return!puts(#k"\nq("#k")");}) (Duff s Device), Tom Duff Lucasfilm, : register n = (count + 7) / 8; /* count > 0 assumed */ switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } count from to (, ) swtich 8, ( count 8 ), case swtich C, Duff C swtich,,,, C (IOCCC) html ; Usenix, ( 1984 ) ftp.uu.net ( 18.18), pub/ioccc/ ;
146 [K&R1] entry, FOR- TRAN, ( ), ANSI C 1.5 : [K&R2, p. 259 Appendix C] C C Ken Thompson B, B Martin Richards BCPL (Basic Combined Programming Language), BCPL CPL (Combined Programming Language Cambridge Programming Language), C P (BCPL ) D,, C char C char : char, character ); care car ( lvalue rvalue, lvalue ;, 6.5 rvalue, FAQ ( ) ftp.eskimo.com u/s/scs/c-faq/., FAQ comp.lang.c,, ( ),, FAQ comp.answers news.answers news.answers FAQ, ; : rtfm.mit.edu ( pub/usenet/news.answers/c-faq/ pub/usenet/comp. lang.c/); ftp.uu.net ( usenet/news.answers/c-faq/) ftp, rtfm.mit.edu FAQ : help [email protected], news.answers meta-faq
147 FAQ (HTML) ; URL eskimo.com/ scs/c-faq/top.html Usenet FAQ FAQ Addison-Wesley : C Programming FAQs: Frequently Asked Questions (ISBN ) [CFAQ] scs/c-faq/book/errata.html ftp://ftp.eskimo.com/u/s/ scs/ftp/c-faq/book/errata HTML PDF
148 20 128
149 21 Jamshid Afshar, Lauri Alanko, Michael B. Allen, David Anderson, Jens Andreasen, Tanner Andrews, Sudheer Apte, Joseph Arceneaux, Randall Atkinson, Kaleb Axon, Daniel Barker, Rick Beem, Peter Bennett, Mathias Bergqvist, Wayne Berke, Dan Bernstein, Tanmoy Bhattacharya, John Bickers, Kevin Black, Gary Blaine, Yuan Bo, Mark J. Bobak, Anthony Borla, Dave Boutcher, Alan Bowler, Michael Bresnahan, Walter Briscoe, Vincent Broman, Robert T. Brown, Stan Brown, John R. Buchan, Joe Buehler, Kimberley Burchett, Gordon Burditt, Scott Burkett, Eberhard Burr, Burkhard Burow, Conor P. Cahill, D Arcy J.M. Cain, Christopher Calabrese, Ian Cargill, Vinit Carpenter, Paul Carter, Mike Chambers, Billy Chambless, C. Ron Charlton, Franklin Chen, Jonathan Chen, Raymond Chen, Richard Cheung, Avinash Chopde, Steve Clamage, Ken Corbin, Dann Corbit, Ian Cottam, Russ Cox, Jonathan Coxhead, Lee Crawford, Nick Cropper, Steve Dahmer, Jim Dalsimer, Andrew Daviel, James Davies, John E. Davis, Ken Delong, Norm Diamond, Jamie Dickson, Bob Dinse, dlynes@plenary-software, Colin Dooley, Jeff Dunlop, Ray Dunn, Stephen M. Dunn, Andrew Dunstan, Michael J. Eager, Scott Ehrlich, Arno Eigenwillig, Yoav Eilat, Dave Eisen, Joe English, Bjorn Engsig, David Evans, Andreas Fassl, Clive D.W. Feather, Dominic Feeley, Simao Ferraz, Pete Filandr, Bill Finke Jr., Chris Flatters, Rod Flores, Alexander Forst, Steve Fosdick, Jeff Francis, Ken Fuchs, Tom Gambill, Dave Gillespie, Samuel Goldstein, Willis Gooch, Tim Goodwin, Alasdair Grant, W. Wesley Groleau, Ron Guilmette, Craig Gullixson, Doug Gwyn, Michael Hafner, Zhonglin Han, Darrel Hankerson, Tony Hansen, Douglas Wilhelm Harder, Elliotte Rusty Harold, Joe Harrington, Guy Harris, John Hascall, Adrian Havill, Richard Heathfield, Des Herriott, Ger Hobbelt, Sam Hobbs, Joel Ray Holveck, Jos Horsmeier, Syed Zaeem Hosain, Blair Houghton, Phil Howard, Peter Hryczanek, James C. Hu, Chin Huang, Jason Hughes, David Hurt, Einar Indridason, Vladimir Ivanovic, Jon Jagger, Ke Jin, Kirk Johnson, David Jones, Larry Jones, Morris M. Keesan, Arjan Kenter, Bhaktha Keshavachar, James Kew, Bill Kilgore, Darrell Kindred, Lawrence Kirby, Kin-ichi Kitano, Peter Klausler, John Kleinjans, Andrew Koenig, Thomas Koenig, Adam Kolawa, Jukka Korpela, Przemyslaw Kowalczyk, Ajoy Krishnan T, Anders Kristensen, Jon Krom, Markus Kuhn, Deepak Kulkarni, Yohan Kun, B. Kurtz, Kaz Kylheku, Oliver Laumann, John Lauro, Felix Lee, Mike Lee, Timothy J. Lee, Tony Lee, Marty Leisner, Eric Lemings, Dave Lewis, Don Libes, Brian Liedtke, Philip Lijnzaad, James D. Lin, Keith Lindsay, Yen-Wei Liu, Paul Long, Patrick J. LoPresti, Christopher Lott, Tim Love, Paul Lutus, Mike McCarty, Tim McDaniel, Michael MacFaden, Allen Mcintosh, J. Scott McKellar, Kevin McMahon, Stuart MacMartin, John 129
150 R. MacMillan, Robert S. Maier, Andrew Main, Bob Makowski, Evan Manning, Barry Margolin, George Marsaglia, George Matas, Brad Mears, Wayne Mery, De Mickey, Rich Miller, Roger Miller, Bill Mitchell, Mark Moraes, Darren Morby, Bernhard Muenzer, David Murphy, Walter Murray, Ralf Muschall, Ken Nakata, Todd Nathan, Taed Nelson, Pedro Zorzenon Neto, Daniel Nielsen, Landon Curt Noll, Tim Norman, Paul Nulsen, David O Brien, Richard A. O Keefe, Adam Kolawa, Keith Edward O hara, James Ojaste, Max Okumoto, Hans Olsson, Thomas Otahal, Lloyd Parkes, Bob Peck, Harry Pehkonen, Andrew Phillips, Christopher Phillips, Francois Pinard, Nick Pitfield, Wayne Pollock, [email protected], Dan Pop, Don Porges, Claudio Potenza, Lutz Prechelt, Lynn Pye, Ed Price, Kevin D. Quitt, Pat Rankin, Arjun Ray, Eric S. Raymond, Christoph Regli, Peter W. Richards, James Robinson, Greg Roelofs, Eric Roode, Manfred Rosenboom, J.M. Rosenstock, Rick Rowe, Michael Rubenstein, Erkki Ruohtula, John C. Rush, John Rushford, Kadda Sahnine, Tomohiko Sakamoto, Matthew Saltzman, Rich Salz, Chip Salzenberg, Matthew Sams, Paul Sand, DaviD W. Sanderson, Frank Sandy, Christopher Sawtell, Jonas Schlein, Paul Schlyter, Doug Schmidt, Rene Schmit, Russell Schulz, Dean Schulze, Jens Schweikhardt, Chris Sears, Peter Seebach, Gisbert W. Selke, Patricia Shanahan, Girija Shanker, Clinton Sheppard, Aaron Sherman, Raymond Shwake, Nathan Sidwell, Thomas Siegel, Peter da Silva, Andrew Simmons, Joshua Simons, Ross Smith, Thad Smith, Henri Socha, Leslie J. Somos, Eric Sosman, Henry Spencer, David Spuler, Frederic Stark, James Stern, Zalman Stern, Michael Sternberg, Geoff Stevens, Alan Stokes, Bob Stout, Dan Stubbs, Tristan Styles, Richard Sullivan, Steve Sullivan, Melanie Summit, Erik Talvola, Christopher Taylor, Dave Taylor, Clarke Thatcher, Wayne Throop, Chris Torek, Steve Traugott, Brian Trial, Nikos Triantafillis, Ilya Tsindlekht, Andrew Tucker, Goran Uddeborg, Rodrigo Vanegas, Jim Van Zandt, Momchil Velikov, Wietse Venema, Tom Verhoeff, Ed Vielmetti, Larry Virden, Chris Volpe, Mark Warren, Alan Watson, Kurt Watzka, Larry Weiss, Martin Weitzel, Howard West, Tom White, Freek Wiedijk, Stephan Wilms, Tim Wilson, Dik T. Winter, Lars Wirzenius, Dave Wolverton, Mitch Wright, Conway Yee, James Youngman, Ozan S. Yigit, and Zhuo Zang Mark Brader, Vinit Carpenter, Stephen Clamage, Jutta Degener, Doug Gwyn, Karl Heuer, and Joseph Kent. Addison- Wesley Debbie Lafferty Tom Stone Karl Heuer, Jutta Degener, Mark Brader, ( Steve Johnson ) FAQ Steve Summit [email protected]
151 [ANSI] [Rationale] American National Standards Institute, American National Standard for Information Systems Programming Language C, ANSI X , ( 11.2 American National Standards Institute, Rationale for American National Standard for Information Systems Programming Language C 11.2 [Bentley] Jon Bentley, Writing Efficient Programs, Prentice-Hall, 1982, ISBN X. [Burki] David Burki, Date Conversions, The C Users Journal, February 1993, pp [LINT] Ian F. Darwin, Checking C Programs with lint, O Reilly, 1988, ISBN [Goldberg] [H&S] David Goldberg, What Every Computer Scientist Should Know about Floating-Point Arithmetic, ACM Computing Surveys, Vol. 23 #1, March, 1991, pp Samuel P. Harbison and Guy L. Steele, Jr., C: A Reference Manual, Fourth Edition, Prentice-Hall, 1995, ISBN [There is also a fifth edition: 2002, ISBN X.] [PCS] Mark R. Horton, Portable C Software, Prentice Hall, 1990, ISBN [POSIX] [ISO] [C9X] Institute of Electrical and Electronics Engineers, Portable Operating System Interface (POSIX) Part 1: System Application Program Interface (API) [C Language], IEEE Std , ISO/IEC International Organization for Standardization, ISO 9899: International Organization for Standardization, WG14/N794 Working Draft
152 132 [K&P] [K&R1] [K&R2] [Knuth] Brian W. Kernighan and P.J. Plauger, The Elements of Programming Style, Second Edition, McGraw-Hill, 1978, ISBN Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Prentice-Hall, 1978, ISBN Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Second Edition, Prentice Hall, 1988, ISBN , Donald E. Knuth, The Art of Computer Programming. Volume 1: Fundamental Algorithms, Third Edition, Addison- Wesley, 1997, ISBN Volume 2: Seminumerical Algorithms, Third Edition, 1997, ISBN Volume 3: Sorting and Searching, Second Edition, 1998, ISBN [CT&P] Andrew Koenig, C Traps and Pitfalls, Addison-Wesley, 1989, ISBN [Marsaglia&Bray] G. Marsaglia and T.A. Bray, A Convenient Method for Generating Normal Variables, SIAM Review, Vol. 6 #3, July, [P&M] Stephen K. Park and Keith W. Miller, Random Number Generators: Good Ones are Hard to Find, Communications of the ACM, Vol. 31 #10, October, 1988, pp (also technical correspondence August, 1989, pp , and July, 1993, pp ). [Plauger] P.J. Plauger, The Standard C Library, Prentice Hall, 1992, ISBN [Plum] [Press et al.] Thomas Plum, C Programming Guidelines, Second Edition, Plum Hall, 1989, ISBN William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery, Numerical Recipes in C, Second Edition, Cambridge University Press, 1992, ISBN [Sedgewick] Robert Sedgewick, Algorithms in C, Addison-Wesley, 1990, ISBN (A new edition is being prepared; the first two volumes are ISBN and )
153 133 [Simonyi&Heller] Charles Simonyi and Martin Heller, The Hungarian Revolution, Byte, August, 1991, pp [Straker] [CFAQ] [Expert] [AGREP] David Straker, C Style: Standards and Guidelines, Prentice Hall, ISBN Steve Summit, C Programming FAQs: Frequently Asked Questions, Addison- Wesley, 1995, ISBN [The book version of this FAQ list; see also scs/c-faq/ book/errata.html.] Peter van der Linden, Expert C Programming: Deep C Secrets, Prentice Hall, 1994, ISBN Sun Wu and Udi Manber, AGREP A Fast Approximate Pattern- Matching Tool, USENIX Conference Proceedings, Winter, 1992, pp [Schumacher, ed.] Schumacher, ed., Software Solutions in C [IHSG]
新・明解C言語入門編『索引』
!... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177
新版 明解C++入門編
511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,
_汪_文前新ok[3.1].doc
普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向
C 1
C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=
CC213
: (Ken-Yi Lee), E-mail: [email protected] 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,
FY.DOC
高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主
( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)
( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.
C/C++语言 - C/C++数据
C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;
CC213
: (Ken-Yi Lee), E-mail: [email protected] 177 [P179] (1) - [P181] [P182] (2) - for [P183] (3) - switch [P184] [P187] [P189] [P194] 178 [ ]; : : int var; : int var[3]; var 2293620 var[0] var[1] 2293620
C/C++ 语言 - 循环
C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf
nooog
C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1
智力测试故事
II 980.00 ... 1... 1... 1... 2... 2... 2... 3... 3... 3... 3... 4... 4... 5... 5... 6... 6... 7... 7... 8... 8... 8... 9... 9...10...10...10 I II...11...11...11...12...13...13...13...14...14...14...15...15...15...16...16...17...17...18...18...19...19...19...19...20...20...21...21...21
ebook8-30
3 0 C C C C C C++ C + + C++ GNU C/C++ GNU egcs UNIX shell s h e l l g a w k P e r l U N I X I / O UNIX shell awk P e r l U N I X C C C C C C U N I X 30.1 C C U N I X 70 C C U N I X U N I X U N I X C Dennis
30,000,000 75,000,000 75,000, (i) (ii) (iii) (iv)
30,000,000 75,000,000 75,000,000 24 (i) (ii) (iii) (iv) # * 1,800,000 1,800,000 15% 3,400,000 3,400,000 15% 4,200,000 4,200,000 10% 8,600,000 8,600,000 10% 12,600,000 12,600,000 88% 10% 16,000,000 16,000,000
I. 1-2 II. 3 III. 4 IV. 5 V. 5 VI. 5 VII. 5 VIII. 6-9 IX. 9 X XI XII. 12 XIII. 13 XIV XV XVI. 16
125-0834I/1405/GH I. 1-2 II. 3 III. 4 IV. 5 V. 5 VI. 5 VII. 5 VIII. 6-9 IX. 9 X. 10-11 XI. 11-12 XII. 12 XIII. 13 XIV. 14-15 XV. 15-16 XVI. 16 I. * ++p ++ p ++ ++ * ++p ++ ++ ++p 1 2 ++ ++ ++ ++ ++ I.
Ps22Pdf
C ( CIP) C /. :, 2001. 7 21 ISBN 7-5624 -2355-5. C........ C. TP312 CIP ( 2001 ) 034496 C * * : 7871092 1 /16 : 14. 25 : 356 20017 1 20017 1 : 1 6 000 ISBN 7-5624-2355-5 / TP311 : 21. 00 C, C,,,, C,, (
1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un
Linux C July 27, 2016 Contents 1 Linux IDE 1 2 GCC 3 2.1 hello.c hello.exe........................... 5 2.2............................... 9 2.2.1 -Wall................................ 9 2.2.2 -E..................................
int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;
Memory & Pointer [email protected] 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,
untitled
不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int
2015年廉政公署民意調查
報 告 摘 要 2015 年 廉 政 公 署 周 年 民 意 調 查 背 景 1.1 為 了 掌 握 香 港 市 民 對 貪 污 問 題 和 廉 政 公 署 工 作 的 看 法, 廉 政 公 署 在 1992 至 2009 年 期 間, 每 年 均 透 過 電 話 訪 問 進 行 公 眾 民 意 調 查 為 更 深 入 了 解 公 眾 對 貪 污 問 題 的 看 法 及 關 注, 以 制 訂 適 切
奇闻怪录
... 1... 1... 2... 3... 3... 4... 4... 5... 5... 6... 8... 9... 10... 10... 11... 11... 13... 13... 14... 14... 15... 16... 17... 21 I ... 22... 23... 23... 24... 25... 25... 26... 27... 28... 29 UFO...
C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40
C C [email protected] C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer
Microsoft Word - John_Ch_1202
新 约 圣 经 伴 读 约 翰 福 音 目 录 说 明..I 序 言 : 圣 经 中 神 圣 启 示 的 三 层.II 按 时 分 粮 的 原 则..VIII 纲 目 XI 第 一 章..1 第 二 章 13 第 三 章 25 第 四 章 37 第 五 章 49 第 六 章 61 第 七 章 73 第 八 章 85 第 九 章 97 第 十 章..109 第 十 一 章..121 第 十 二 章..133
全唐诗50
... 1... 1... 2... 2... 3... 3... 3... 4... 4... 5... 5... 6... 6... 6... 7... 7... 7... 8... 8... 8... 9 I II... 9...10...10...10...11...11...11...12...12...12...13...14...14...15...15...16...16...16...17,...17...18...18...19...19...19
1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7
1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7-80097 - 564-9 /TP 8 : 10. 00 ,,,, 1994 NCRE,,, ( ),,,,,
ebook15-C
C 1 1.1 l s ( 1 ) - i i 4. 14 - d $ l s -ldi /etc/. /etc/.. - i i 3077 drwxr-sr-x 7 bin 2048 Aug 5 20:12 /etc/./ 2 drwxr-xr-x 13 root 512 Aug 5 20:11 /etc/../ $ls -ldi /. /..... i 2 2 drwxr-xr-x 13 root
C
C 2017 4 1 1. 2. while 3. 4. 5. for 6. 2/161 C 7. 8. (do while) 9. 10. (nested loop) 11. 12. 3/161 C 1. I 1 // summing.c: 2 #include 3 int main(void) 4 { 5 long num; 6 long sum = 0L; 7 int status;
C++ 程式設計
C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004
untitled
1 DBF (READDBF.C)... 1 2 (filetest.c)...2 3 (mousetes.c)...3 4 (painttes.c)...5 5 (dirtest.c)...9 6 (list.c)...9 1 dbf (readdbf.c) /* dbf */ #include int rf,k,reclen,addr,*p1; long brec,erec,i,j,recnum,*p2;
untitled
Introduction to Programming ( 數 ) Lecture 3 Spring 2005 March 4, 2005 Lecture 2 Outline 數 料 If if 狀 if 2 (Standard Output, stdout): 料. ((Standard Input, stdin): 料. 類 數 數 數 說 printf 見 數 puts 串 數 putchar
C/C++语言 - 分支结构
C/C++ Table of contents 1. if 2. if else 3. 4. 5. 6. continue break 7. switch 1 if if i // colddays.c: # include int main ( void ) { const int FREEZING = 0; float temperature ; int cold_ days
[改訂新版]C言語による標準アルゴリズム事典
iii C 1991 SEND + MORE = MONEY C 100 2003 Java 2003 27 PC-9800 C BMP SVG EPS BMPSVG WindowsMacLinux Web iv int main() int main(void) EXIT_SUCCESS 0 https://github.com/okumuralab/ algo-c TEX TEX PDF PDF
1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File
51 C 51 51 C C C C C C * 2003-3-30 [email protected] C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test
untitled
A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (
施 的 年 度 維 修 工 程 已 於 4 月 15 日 完 成, 並 於 4 月 16 日 重 新 開 放 給 市 民 使 用 ii. 天 水 圍 游 泳 池 的 年 度 維 修 工 程 已 於 3 月 31 日 完 成, 並 於 4 月 1 日 重 新 開 放 給 市 民 使 用 iii. 元
地 委 會 文 件 2016/ 第 25 號 ( 於 6.5.2016 會 議 討 論 ) 康 樂 及 文 化 事 務 署 在 元 朗 區 內 舉 辦 的 康 樂 體 育 活 動 及 設 施 管 理 綜 合 匯 報 (2016 年 5 月 號 報 告 ) 目 的 本 文 件 旨 在 向 各 委 員 匯 報 康 樂 及 文 化 事 務 署 ( 康 文 署 ) 於 2016 年 2 月 至 5 月 在
untitled
1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override
对联故事
980.00 ... 1... 1... 2... 3... 3... 4... 4... 5... 5... 6... 7... 7... 8... 9...10...10...11...12...13...13...14...15...15...16...17 I II...18...18...19...19...20...21...21...22...22...23...24...25...25...26...26...27...28...29...29...30...30...31...32...32...33...34...34...35
我 非 常 希 望 该 小 组 的 建 议 尤 其 是 其 执 行 摘 要 能 受 到 将 于 2000 年 9 月 来 纽 约 参 加 千 年 首 脑 会 议 的 所 有 领 导 人 的 注 意 这 次 历 史 性 的 高 级 别 会 议 提 供 了 一 个 独 特 的 机 会 使 我 们 能 够
联 合 国 A/55/305 大 会 安 全 理 事 会 Distr.: General 21 August 2000 Chinese Original: English 大 会 第 五 十 五 届 会 议 临 时 议 程 项 目 87 整 个 维 持 和 平 行 动 问 题 所 有 方 面 的 全 盘 审 查 安 全 理 事 会 第 五 十 五 年 2000 年 8 月 21 日 秘 书 长 给
一、
... 1...24...58 - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - i. ii. iii. iv. i. ii. iii. iv. v. vi. vii. viii. ix. x. - 9 - xi. - 10 - - 11 - -12- -13- -14- -15- C. @ -16- @ -17- -18- -19- -20- -21- -22-
-i-
-i- -ii- -iii- -iv- -v- -vi- -vii- -viii- -ix- -x- -xi- -xii- 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-9 1-10 1-11 1-12 1-13 1-14 1-15 1-16 1-17 1-18 1-19 1-20 1-21 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 2-9 2-10 2-11
Microsoft Word - 强迫性活动一览表.docx
1 1 - / 2 - / 3 - / 4 - / 5 - I. 1. / 2. / 3. 4. 5. 6. 7. 8. 9 10 11. 12. 2 13. 14. 15. 16. 17. 18. 19. 20 21. 22 23. 24. / / 25. 26. 27. 28. 29. 30. 31. II. 1. 2 3. 4 3 5. 6 7 8. 9 10 11 12 13 14. 15.
<4D F736F F D20BB4FAA46BFA4B2C4A447B4C15F D313038A67E5FBAEEA658B56FAE69B9EAAC49A4E8AED72D5FAED6A977A5BB5F >
行 政 院 104 年 11 月 2 日 院 臺 綜 字 第 1040149345A 號 函 核 定 臺 東 縣 第 二 期 (105-108 年 ) 綜 合 發 展 實 施 方 案 ( 核 定 本 ) 臺 東 縣 政 府 中 華 民 國 1 0 4 年 1 1 月 臺 東 縣 第 二 期 (105-108 年 ) 綜 合 發 展 實 施 方 案 ( 核 定 本 ) 目 錄 第 一 章 前 言...
1 2 6 8 15 36 48 55 58 65 67 74 76 150 152 1 3 1 2 4 2 2001 2000 1999 12 31 12 31 12 31 304,347 322,932 231,047 14,018 16,154 5,665 (i) 0.162 0.193 0.082 (ii) 0.165 0.227 0.082 (iii) 10.08 13.37 6.47 0.688
W. Richard Stevens UNIX Sockets API echo Sockets TCP OOB IO C struct C/C++ UNIX fork() select(2)/poll(2)/epoll(4) IO IO CPU 100% libevent UNIX CPU IO
Linux muduo C++ ([email protected]) 2012-09-30 C++ TCP C++ x86-64 Linux TCP one loop per thread Linux native muduo C++ IT 5 C++ muduo 2 C++ C++ Primer 4 W. Richard Stevens UNIX Sockets API echo Sockets
Microsoft Word - COC HKROO App I _Chi_ Jan2012.doc
附 錄 I 目 錄 項 目 貨 品 描 述 頁 數 (I) 活 動 物 ; 動 物 1 (II) 植 物 2 (III) 動 物 或 植 物 脂 肪 及 油 及 其 分 化 後 剩 餘 的 ; 經 處 理 可 食 的 脂 肪 ; 動 物 或 植 物 蠟 2 (IV) 經 配 製 的 食 品 ; 飲 料 酒 及 醋 ; 煙 草 及 製 成 的 煙 草 代 替 品 2 (V) 礦 產 5 (VI) 化
epub 33-8
8 1) 2) 3) A S C I I 4 C I / O I / 8.1 8.1.1 1. ANSI C F I L E s t d i o. h typedef struct i n t _ f d ; i n t _ c l e f t ; i n t _ m o d e ; c h a r *_ n e x t ; char *_buff; /* /* /* /* /* 1 5 4 C FILE
, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1
21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414
51 C 51 isp 10 C PCB C C C C KEIL
http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom
2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%
2013 ( 28 ) ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 10 B 1 C 1 D 5 E 5 F 1 G II 5 H 30 1 2013 C 1 #include 2 int main(void) 3
Microsoft Word - CPE考生使用手冊160524.docx
大 學 程 式 能 力 檢 定 (CPE) 考 生 使 用 手 冊 2016 年 5 月 24 日 這 份 手 冊 提 供 給 參 加 CPE 檢 定 考 試 的 考 生 內 容 包 含 考 試 環 境 的 使 用, 以 及 解 題 時 所 使 用 I/O 的 基 本 知 識 1. 如 欲 報 名 參 加 CPE 考 試, 請 先 於 CPE 網 站 完 成 帳 號 註 冊, 然 後 再 報 名 該
C, Win-TC Turbo C,, C, C,,,, C C, : Win-TC C, 23,,, 15,, C Turbo C Win-TC Turbo C,,,, 2005 1 W in -TC 1 Win-TC 1 1. Win-TC 1 2. Win-TC 1 3. Win-TC 1 2 Win-TC 3 1. 3 2. 3 3. 4 4. 4 5. 4 6. 4 7. 5 8. 5 9.
<D6D0B9FAB9C5CAB757512E6D7073>
黄 河 文 明 的 历 史 变 迁 丛 书 编 委 会 学 术 顾 问 李 学 勤 朱 绍 侯 姚 瀛 艇 郝 本 性 晁 福 林 王 巍 主 任 李 小 建 苗 长 虹 副 主 任 覃 成 林 高 有 鹏 牛 建 强 刘 东 勋 主 编 李 玉 洁 编 委 苗 书 梅 程 遂 营 王 蕴 智 张 新 斌 郑 慧 生 涂 白 奎 袁 俊 杰 薛 瑞 泽 陈 朝 云 孔 学 郑 贞 富 陈 彩 琴 石
Ps22Pdf
( 98 ) C ( ) ( )158 1998 C : C C C,,, C,, : C ( ) : : (, 100084) : : : 7871092 1/ 16 :18 25 :415 : 2000 3 1 2000 3 1 : ISBN 7 302 01166 4/ T P432 : 00016000 : 22 00 ( 98 ) 20 90,,, ;,,, 1994, 1998, 160,
中医疗法(下).doc
( 20 010010) 787 1092 1/32 498.50 4 980 2004 9 1 2004 9 1 1 1 000 ISBN 7-204-05940-9/R 019 1880.00 ( 20.00 ) ...1...2...3...4...13...15...17...17...24...25...26...26...28...28...29...31...31...33...33
Microsoft Word - Final Chi-Report _PlanD-KlnEast_V7_ES_.doc
九 龍 東 商 業 的 統 計 調 查 - 行 政 摘 要 - 2011 年 5 月 統 計 圖 行 政 摘 要...1 圖 I: 在 不 同 地 區 及 樓 宇 類 別 的 數 目 及 比 例...9 圖 II: 影 響 選 擇 地 點 的 因 素 的 重 要 程 度 對 比 就 現 時 所 在 地 點 各 項 因 素 的 滿 意 程 度...20 圖 III: 影 響 選 擇 樓 宇 的 因 素
眼病防治
( 20 010010) 787 1092 1/32 498.50 4 980 2004 9 1 2004 9 1 1 1 000 ISBN 7-204-05940-9/R 019 1880.00 ( 20.00 ) ...1...1...2...3...5...5...6...7...9... 11...13...14...15...17...18...19...20...21 I II...21...22...23...24...25...27...27...28...29...30...31...33...33...34...36...38...39...40...41...42...43...45
中国南北特色风味名菜 _八)
( 20 010010) 7871092 1/32 356.25 4 760 2004 8 1 2004 8 1 11 000 ISBN 7-204-05943-3/Z102 1026.00 ( 18.00 ) ...1...2...2...4...6...7...8...9... 10... 11... 12... 13... 13... 14... 15... 17... 18... 19...
CC213
: (Ken-Yi Lee), E-mail: [email protected] 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++
RDEC-RES
RDEC-RES-089-005 RDEC-RES-089-005 VI I II III 6 IV 7 3 V VI VII VIII IX X XI XII XIII XIV XV XVI XVII XVIII XIX XX 1 2 3 4 5 6 7 8 躰 ( 9 10 躰 11 12 躰 1 13 14 躰 15 16 躰 17 18 19 1 20 21 22 2 23 24 25 26
Microsoft Word - Entry-Level Occupational Competencies for TCM in Canada200910_ch _2_.doc
草 稿 致 省 級 管 理 單 位 之 推 薦 書 二 零 零 九 年 十 月 十 七 日 加 拿 大 中 醫 管 理 局 聯 盟 All rights reserved 序 言 加 拿 大 中 醫 管 理 局 聯 盟, 於 二 零 零 八 年 一 月 至 二 零 零 九 年 十 月 間, 擬 定 傳 統 中 醫 執 業 之 基 礎 文 件 由 臨 床 經 驗 豐 富 之 中 醫 師 教 育 者 及
How to Debug Tuxedo Server printf( Input data is: %s, inputstr); fprintf(stdout, Input data is %s, inputstr); fprintf(stderr, Input data is %s, inputstr); printf( Return data is: %s, outputstr); tpreturn(tpsuccess,
全唐诗28
... 1... 1... 1... 2... 2... 2... 3... 3... 4... 4... 4... 5... 5... 5... 5... 6... 6... 6... 6... 7... 7... 7... 7... 8... 8 I II... 8... 9... 9... 9...10...10...10...11...11...11...11...12...12...12...13...13...13...14...14...14...15...15...15...16...16...16...17...17
untitled
MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12
Microsoft PowerPoint - 20-string-s.pptx
String 1 String/ 1.: char s1[10]; char *s2; char s3[] = "Chan Tai Man"; char s4[20] = "Chan Siu Ming"; char s5[]={'h','e','l','l','o','\0'; 0 1 2 3 4 5 6 7 8 9 10 11 12 s3 C h a n T a i \0 M a n \0 printf
bingdian001.com
TSM12M TSM12 STM8L152C6, STM8L152R8 MSP430F5325 [email protected]! /******************************************************************************* * : TSM12.c * : * : 2013/10/21 * : TSM12, STM8L f(sysclk)
(b)
1. (a) (b) (c) 22 85155 (i) (ii) 2200 5 35% 20% 500 3,000 3015 50% 30 (i) (ii) (iii) (iii) 30% QFII 15% H (20)(5) (iv) (i)(ii) (iii) (iv) (v) 10 30 (vi) 5% (vii) (1) (1) 25%(1) (viii) (ix) 10% 20 45 20
II II
I I II II III 1. 2. 3. III 4. IV 5. 6. 8. 9. 10. 12. IV V V VI VI VII VII VIII VIII IX IX X X XI XI XII XII 1 1 2 2 3 3 4 33 35 4 5 5 6 6 7 ( ) 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17
6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit
6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128
95年度社區教育學習計畫執行成果報告
宜 蘭 縣 政 府 環 境 保 護 局 101 年 度 宜 蘭 縣 環 境 教 育 委 託 執 行 計 畫 期 末 報 告 ( 定 稿 版 ) 社 團 法 人 宜 蘭 縣 博 物 館 家 族 協 會 中 華 民 國 102 年 6 月 宜 蘭 縣 政 府 環 境 保 護 局 101 年 度 宜 蘭 縣 環 境 教 育 委 託 執 行 計 畫 期 末 報 告 ( 定 稿 版 ) 計 畫 主 持 人 :
「保險中介人資格考試」手冊
目 錄 內 容 頁 次 1. 引 言.. 1 2. 考 試.. 1 3. 報 考 詳 情.. 3 4. 註 冊 手 續.. 3 5. 考 試 費.. 4 6. 准 考 證.. 5 7. 選 擇 考 試 時 間.. 5 8. 電 腦 或 系 統 出 現 問 題..... 5 9. 考 試 規 則.. 5 10. 取 消 資 格.. 6 11. 核 實 考 生 身 分.. 6 12. 發 出 成 績 通
心理障碍防治(下).doc
( 20 010010) 787 1092 1/32 498.50 4 980 2004 9 1 2004 9 1 1 1 000 ISBN 7-204-05940-9/R 019 1880.00 ( 20.00 ) ...1...2...2...3...4...5...6...7...8...9...10... 11...12...13...15...16...17...19...21 I ...23...24...26...27...28...30...32...34...37...39...40...42...42...44...47...50...52...56...58...60...64...68
財 務 委 員 會 審 核 2014 至 2015 年 度 開 支 預 算 的 報 告 2014 年 7 月
香 港 特 別 行 政 區 立 法 會 財 務 委 員 會 審 核 2014 至 2015 年 度 開 支 預 算 的 報 告 2014 年 7 月 財 務 委 員 會 審 核 2014 至 2015 年 度 開 支 預 算 的 報 告 2014 年 7 月 章 節 目 錄 頁 數 I 序 言 1-2 II 公 務 員 事 務 3-9 III 司 法 及 法 律 事 務 10-19 IV 財 經 事
3.1 num = 3 ch = 'C' 2
Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:
2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d
2013 18 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp, Compilation Error cin scanf Time Limit Exceeded 1: A 5 B 5 C 5 D 5 E 5 F 5 1 2013 C 1 # include 2 int main ( void ) 3 { 4 int cases, a, b,
<4D6963726F736F667420576F7264202D205B345DB5D8AE4CACD732303135AECAAFC5C1C9C1DCBDD0AB48A4CEB3F8A657AAED>
華 夏 盃 全 國 全 國 數 學 奧 林 匹 克 邀 請 賽 ( 華 南 賽 區 ) 晉 級 賽 比 賽 詳 情 : 一 比 賽 對 象 : 小 學 一 至 六 年 級 中 學 一 二 年 級 二 比 賽 日 期 及 時 間 : 年 2 月 15 日 ( 星 期 日 ) 小 學 組 小 一 級 小 二 級 小 三 級 小 四 級 小 五 級 小 六 級 時 間 13:10~1:20 13:10~1:20
科学计算的语言-FORTRAN95
科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造
C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha
CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc
江苏宁沪高速公路股份有限公司.PDF
- 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - 33.33% ( ) ( ) ( ) 33.33% ( ) ( ) ( ) 1 1 1992 8 3200001100976 1997 6 27 H 12.22 2001 1 16 A 1.5 2001 12 3 503,774.75 14,914,399,845.00 13,445,370,274.00
Microsoft Word - MP2018_Report_Chi _12Apr2012_.doc
人 力 資 源 推 算 報 告 香 港 特 別 行 政 區 政 府 二 零 一 二 年 四 月 此 頁 刻 意 留 空 - 2 - 目 錄 頁 前 言 詞 彙 縮 寫 及 注 意 事 項 摘 要 第 一 章 : 第 二 章 : 第 三 章 : 第 四 章 : 附 件 一 : 附 件 二 : 附 件 三 : 附 件 四 : 附 件 五 : 附 件 六 : 附 件 七 : 引 言 及 技 術 大 綱 人
南華大學數位論文
1 i -------------------------------------------------- ii iii iv v vi vii 36~39 108 viii 15 108 ix 1 2 3 30 1 ~43 2 3 ~16 1 2 4 4 5 3 6 8 6 4 4 7 15 8 ----- 5 94 4 5 6 43 10 78 9 7 10 11 12 10 11 12 9137
李天命的思考藝術
ii iii iv v vi vii viii ix x 3 1 2 3 4 4 5 6 7 8 9 5 10 1 2 11 6 12 13 7 8 14 15 16 17 18 9 19 20 21 22 10 23 24 23 11 25 26 7 27 28 12 13 29 30 31 28 32 14 33 34 35 36 5 15 3 1 2 3 4 5 6 7 8 9 10 11
皮肤病防治.doc
...1...1...2...3...4...5...6...7...7...9...10... 11...12...14...15...16...18...19...21 I ...22...22...24...25...26...27...27...29...30...31...32...33...34...34...36...36...37...38...40...41...41...42 II
性病防治
...1...2...3...4...5...5...6...7...7...7...8...8...9...9...10...10... 11... 11 I ...12...12...12...13...14...14...15...17...20...20...21...22...23...23...25...27...33...34...34...35...35 II ...36...38...39...40...41...44...49...49...53...56...57...57...58...58...59...60...60...63...63...65...66
中国南北特色风味名菜 _一)
...1...1...2...3...3...4...5...6...7...7...8...9... 10... 11... 13... 13... 14... 16... 17 I ... 18... 19... 20... 21... 22... 23... 24... 25... 27... 28... 29... 30... 32... 33... 34... 35... 36... 37...
