书籍详情
C语言参考手册:英文版
作者:Samuel P.Harbison Ⅲ,Guy L.Steele,Jr.著
出版社:人民邮电出版社
出版时间:2003-06-01
ISBN:9787115111944
定价:¥45.00
购买这本书可以去
内容简介
本书是关于C语言的详尽的参考手册。最新的第五版增加了对C99标准的介绍,更加符合当前C语言学习的需要。全书共两大部分24章。第一部分讨论了C语言的所有语言特征,包括词法、预处理机制、声明、类型、表达式、语句以及函数等基本语言特性的介绍。第二部分讨论了C语言的标准库,根据它们不同的功能分别详细介绍。为帮助读者理解相关概念,本书在讨论C语言及其标准库的各方面问题时,提供了许多实例和解释。许多章里还提供了练习题,书后给出了主要练习的解答。这些练习的主要目的也为帮助读者理解C语言的基本机制及其重要细节,其中并不涉及复杂的程序设计技术与问题。本书可以作为高等院校计算机专业C语言课程的教材和参考书,对于一般的C程序员也有重要的参考价值。
作者简介
暂缺《C语言参考手册:英文版》作者简介
目录
PART 1 The C Language 1
1 Intnduction 3
l .l The Evolution of C 3
l .2 Which Dialect of C Should You Use? 6
l.3 An Overview of C Programming 7
l.4 Conformance 8
l.5 Syntax Notation 9
2 Lexical Elements 11
2.l Character Set l l
2.2 Comments 18
2.3 Tokens 20
2.4 Operators and Separators 20
2.5 Identifiers 2l
2.6 Keywords 23
2.7 Constants 24
2.8 C++Compatibility 38
2.9 On Character Sets, Repertoires, and Encodings 39
2.l0 Exercises 4l
3 The C bopmeessor 43
3.l Preprocessor Commands 43
3.2 Preprocessor Lexical Conventions 44
3.3 Definition and Replacement 46
3.4 File Inclusion 59
3.5 Conditional Compilation 6l
3.6 Explicit Line Numbering 66
3.7 Pragma Directive 67
3.8 Error Directive 69
3.9 C++Compatibility 70
3.l0 Exercises 7l
4 Declarations 73
4.l Organization of Declarations 74
4.2 Terminology 75
4.3 Storage Class and Function Specifiers 83
4.4 Type Specifiers and Qualifiers 86
4.5 Declarators 95
4.6 Initializers l03
4.7 Implicit Declarations l l3
4.8 External Names l l3
4.9 C++ Compatibility l l6
4.l0 Exercises 1l9
5 Types 123
5.l Integer Types l24
5.2 Floating-Point Types l32
5.3 Pointer Types l36
5.4 Array Types l40
5.5 Enumerated Types l45
5.6 Structure Types l48
5.7 UnionTypes l60
5.8 Function Types l65
5.9 The void Type l68
5.l0 Typedef Names l68
5.ll Type Compatibility l72
5.l2 Type Names and Abstract Declarators l76
5.l3 C++ Compatibility 178
5.l4 Exercises l79
6 Conversions and Representations 181
6. l Representations l8l
6.2 Conversions l88
6.3 The Usual Conversions l94
6.4 C++ Compatibility 200
6.5 Exercises 20l
7 Exprcssions 203
7. l Objects, Lvalues, and Designators 203
7.2 Expressions and Precedence 204
7.3 Primary Expressions 207
7.4 Postfix Expressions 2l0
7.5 Unary Expressions 2l9
7.6 Binary Operator Expressions 227
7.7 Logical Operator Expressions 243
7.8 Conditional Expressions 244
7.9 Assignment Expressions 246
7.l0 Sequential Expressions 249
7.l1 Constant ExPressions 250
7.12 Orde of Evaluation 253
7.l3 Discarded Values 255
7.l4 Ophmization of Memory Accesses 256
7.l5 C++ Compatibility 257
7.l6 Exercises 258
8 Statements 259
8.l General Syntactic Rules for Statements 260
8.2 Expression Statements 260
8.3 Labeled Statements 261
8.4 Compound Statements 262
8.5 Conditional Statements 264
8.6 Iteraive Statements 266
8.7 Switch Statements 274
8.8 Break and Conhnue Statements 277
8.9 Return Statements 279
8.l0 Goto Statements 280
8.ll Null Statements 28l
8.12 C++ Compatibility 282
8.l3 Exercises 282
9 Functions 285
9.l Function Definitions 286
9.2 Function Prototypes 289
9.3 Formal Parameter Declarations 295
9.4 Adustments to Parameter rypes 298
9.5 Mmeter-Passing Conventions 299
9.6 Agreement of Parameters 3(X)
9.7 Function Return Types 30l
9.8 Agreement of Return rypes 302
9.9 The Main Program 303
9.l0 Inline Functions 304
9.ll C++ Compatibility 306
9.l2 Exercises 307
PART 2 The C Libraries 309
l0 Introduction to the Libraries 311
l0.l Standard C Facilihes 3l2
l0.2 C++ Compatibility 3l3
l0.3 Library Headers and Names 3l6
11 Standard Language Addltions 325
ll.l NULL, Ptrdiff_t, siz_t, offsetof 325
l1.2 EDOM, ERANGE, EILSEQ, errno, strerror, Perror 327
ll.3 bool, false, true 329
ll.4 valist, vastart, va_arg va_end 329
ll.5 Standard C Operator Macros 333
l2 Charaoter Processing 335
l2.l isalnum, isalpha, iscntrl, iswalnum, iswalpha, iswcntrl 336
12.2 iscsym, iscsymf 338
l2.3 isdigit, isodigit, isxdigit, iswdigit, iswxdigit 338
l2.4 isgraph, isprint, ispunct, iswgraph, iswprint, iswpunct 339
l2.5 islower, isupper iswlower, iswupper 340
l2.6 isblank, isspace, iswhite, iswspace 34l
l2.7 toascii 34l
l2.8 toint 342
l2.9 tolower, toupper, towlower, towupper 342
l2.l0 wctype_t, wctype, iswctype 343
l2. ll wctrans_t, wctrans 344
13 String Processing 347
l3.l stroat, strncat, wcscat, wcsncat 348
l3.2 strcmp, strncmp, wcscmp, wcsncmp 349
l3.3 strcpy, strncpy, wcscpy, wcsncpy 350
l3.4 strlen, wcslen 35l
l3.5 strehr, strrchr, wcschr, wcsrchr 351
l3.6 strspn, strcspn, strpbrk, strrpbrk, wcsspn, wcscspn, wcspbrk 352
l3.7 strstr strtok, wcsstr wcstok 354
l3.8 strtod, sotof, strtold, strtol, strtoll, strttoul, strtoull 355
l3.9 atof, atoi, atol, atoll 356
l3.l0 streoll, strxfrm, wcscoll, wcsxfrm 356
14 Memory Functions 359
14.1 memchr, wmemchr 359
l4.2 memcmp, wmemcmp 360
l4.3 memcpy, memccpy memmove, wmemcpy, wmemmove 36l
l4.4 memset, wmemset 362
l5 Input/output Facilities 363
l5.l FILE, EOF, wchar_t, wint_t, WEOF 365
l5.2 fopen, fclose, mush, freopen, fwide 366
l5.3 setbuf, setvbuf 370
l5.4 stdin, stdout, stderr 37l
l5.5 fseek, ftell, rewind, fgetpos, fsetpos 372
l5.6 fgetc, fgetwc, getc, getwc, getchar getwchar, ungetc, ungetwc 374
l5.7 fgets, fgetws, gets 376
l5.8 fscanf, fwscanf, scanf, wscanf, sscanf, swscanf 377
l5.9 fputc, fputwc, putc, putwc, putchar, putwchar 385
l5.l0 fputs, fputws, puts 386
l5.l l fprintf, printf, sprint f, snprintf, fwprintf, wprintf, swprintf 387
l5.l2 v[x]prrintf, v[x]scanf 40l
l5.l3 fread, fwrite 402
l5.l4 feof, fermr, clearerr 404
l5.l5 remove, rename 404
l5.l6 tmpfile, tmpnam, mktemp 405
l6 General Utilities 407
l6.l malloc, calloc, mlalloc, clalloc, free, cfree 407
l6.2 rand, srand, RAND_NAX 4l0
l6.3 atof, atoi, atol, atoll l 4ll
l6.4 strtod, strtof, strtold, strtol, strtoll, strtoul, strtoull 4l2
l6.5 abort, atexit, exit, _Exit, EXIT_FAILURE, EXIT_SUCCESS 4l4
l6.6 getenv 4l5
l6.7 system 4l6
l6.8 bsearch, qsort 4l7
l6.9 abs, labs, llabs, div, ldiv, lldiv 4l9
l6.l0 mblen, mbtowc, wctomb 420
l6.ll mbstowcs, wcstombs 422
17 Mathematical Functions 425
l7.l abs, labs, llabs, div ldiv, lldiv 426
l7.2 fabs 426
l7.3 ceil, floor, lrint, llrint, lround, llround, nearbyint, round, rint,trunc 427
l7.4 fmod, remainder, remquo 428
l7.5 frexp, ldexp, modf, scalbn 429
l7.6 exp, exp2, expml, ilogb, log, logl0, loglp, log2, logb 430
l7.7 cbrt, fma, hypot, pow, sqrt 432
l7.8 rand, srand, RAND_MAX 432
l7.9 cos, sin, tan, cosh, sinh, tanh 433
l7. l0 acos, asin, atan, atan2, acosh, asinh, atanh 434
l7.ll fdim, fmax, fmin 435
l7. l2 Type-Generic Macros 435
l7. l3 erf, erfc, lgamma, tgamma 439
l7. l4 fpelassify, isfinite, isinf, isnan, isnormal, signbit 440
l7. l5 copysign, nan, nextafer, nexttoward 441
l7. l6 isgreater, isgreaterequal, isless, islessequal, islessgreater,isunordered 442
l8 Time and Date Functions 443
l8. l clock, clock_t, CLOCKS_PER_SEC, times 443
l8.2 time, time_t 445
l8.3 asctime, ctime 445
l8.4 gmtime, localtime, mktime 446
l8.5 difftime 447
l8.6 strftime, wcsftime 448
19 Control Functions 453
l9.l assert, NDEBUG 453
l9.2 system, exec 454
19.3 exit, aboIt 454
l9.4 set jmp, longimp,jmp_buf 454
l9.5 atexit 456
l9.6 signal, raise, gsignal, ssignal, psignal 456
l9.7 sleep, alarm 458
20 Locale 461
20.l setlocale 46l
20.2 localeconv 463
2l Extended Integer Types 467
2l. l General Rules 467
2l.2 Exact-Size Integer Types 470
2l.3 Least-Size Types of a Minimum Width 47l
2l.4 Fast Types of a Minimum Width 472
2l.5 Pointer-Size and Maximum-Size Integer Types 473
2l.6 Ranges of ptrdiff_t, size_t, wchap_t, wint_t, and sig_atomic_t 474
2l.7 imaxabs, imaxdiv, imaxdiv_t 474
2l.8 strtoimax, strtouimax 475
2l.9 wcstoimax, wcstoumax 475
22 Floating-Point Environment 477
22.l Overview 477
22.2 Floating-Point Environment 478
22.3 Floating-Point Exceptions 479
22.4 Floating-Point Rounding Modes 48l
22'5 Floating-Point Expression Contraction 48l
23 Complex Arithmetic 483
23.l Complex Library Conventions 483
23.2 complex, _Complex_I, imaginary, _Imaginary_I, I 484
23.3 CX_LIMITED_RANGE 484
23.4 cacos, casin, catan, ccos, csin, ctan 485
23.5 cacosh, casinh, catanh, ccosh, csinh, ctanh 486
23.6 cexp, clog, cabs, cpow csqrt 487
23.7 carg, cimag, creal, conj, cproj 488
24 Wide and Multibyte Facilities 489
24.l Basic rypes and Macros 489
24.2 Conversions Between Wide and Multibyte Characters 490
24.3 Conversions Between Wide and Multibyte Strings 49l
24.4 Conversions to Arithmetic Types 493
24.5 Input and Output Functions 493
1 Intnduction 3
l .l The Evolution of C 3
l .2 Which Dialect of C Should You Use? 6
l.3 An Overview of C Programming 7
l.4 Conformance 8
l.5 Syntax Notation 9
2 Lexical Elements 11
2.l Character Set l l
2.2 Comments 18
2.3 Tokens 20
2.4 Operators and Separators 20
2.5 Identifiers 2l
2.6 Keywords 23
2.7 Constants 24
2.8 C++Compatibility 38
2.9 On Character Sets, Repertoires, and Encodings 39
2.l0 Exercises 4l
3 The C bopmeessor 43
3.l Preprocessor Commands 43
3.2 Preprocessor Lexical Conventions 44
3.3 Definition and Replacement 46
3.4 File Inclusion 59
3.5 Conditional Compilation 6l
3.6 Explicit Line Numbering 66
3.7 Pragma Directive 67
3.8 Error Directive 69
3.9 C++Compatibility 70
3.l0 Exercises 7l
4 Declarations 73
4.l Organization of Declarations 74
4.2 Terminology 75
4.3 Storage Class and Function Specifiers 83
4.4 Type Specifiers and Qualifiers 86
4.5 Declarators 95
4.6 Initializers l03
4.7 Implicit Declarations l l3
4.8 External Names l l3
4.9 C++ Compatibility l l6
4.l0 Exercises 1l9
5 Types 123
5.l Integer Types l24
5.2 Floating-Point Types l32
5.3 Pointer Types l36
5.4 Array Types l40
5.5 Enumerated Types l45
5.6 Structure Types l48
5.7 UnionTypes l60
5.8 Function Types l65
5.9 The void Type l68
5.l0 Typedef Names l68
5.ll Type Compatibility l72
5.l2 Type Names and Abstract Declarators l76
5.l3 C++ Compatibility 178
5.l4 Exercises l79
6 Conversions and Representations 181
6. l Representations l8l
6.2 Conversions l88
6.3 The Usual Conversions l94
6.4 C++ Compatibility 200
6.5 Exercises 20l
7 Exprcssions 203
7. l Objects, Lvalues, and Designators 203
7.2 Expressions and Precedence 204
7.3 Primary Expressions 207
7.4 Postfix Expressions 2l0
7.5 Unary Expressions 2l9
7.6 Binary Operator Expressions 227
7.7 Logical Operator Expressions 243
7.8 Conditional Expressions 244
7.9 Assignment Expressions 246
7.l0 Sequential Expressions 249
7.l1 Constant ExPressions 250
7.12 Orde of Evaluation 253
7.l3 Discarded Values 255
7.l4 Ophmization of Memory Accesses 256
7.l5 C++ Compatibility 257
7.l6 Exercises 258
8 Statements 259
8.l General Syntactic Rules for Statements 260
8.2 Expression Statements 260
8.3 Labeled Statements 261
8.4 Compound Statements 262
8.5 Conditional Statements 264
8.6 Iteraive Statements 266
8.7 Switch Statements 274
8.8 Break and Conhnue Statements 277
8.9 Return Statements 279
8.l0 Goto Statements 280
8.ll Null Statements 28l
8.12 C++ Compatibility 282
8.l3 Exercises 282
9 Functions 285
9.l Function Definitions 286
9.2 Function Prototypes 289
9.3 Formal Parameter Declarations 295
9.4 Adustments to Parameter rypes 298
9.5 Mmeter-Passing Conventions 299
9.6 Agreement of Parameters 3(X)
9.7 Function Return Types 30l
9.8 Agreement of Return rypes 302
9.9 The Main Program 303
9.l0 Inline Functions 304
9.ll C++ Compatibility 306
9.l2 Exercises 307
PART 2 The C Libraries 309
l0 Introduction to the Libraries 311
l0.l Standard C Facilihes 3l2
l0.2 C++ Compatibility 3l3
l0.3 Library Headers and Names 3l6
11 Standard Language Addltions 325
ll.l NULL, Ptrdiff_t, siz_t, offsetof 325
l1.2 EDOM, ERANGE, EILSEQ, errno, strerror, Perror 327
ll.3 bool, false, true 329
ll.4 valist, vastart, va_arg va_end 329
ll.5 Standard C Operator Macros 333
l2 Charaoter Processing 335
l2.l isalnum, isalpha, iscntrl, iswalnum, iswalpha, iswcntrl 336
12.2 iscsym, iscsymf 338
l2.3 isdigit, isodigit, isxdigit, iswdigit, iswxdigit 338
l2.4 isgraph, isprint, ispunct, iswgraph, iswprint, iswpunct 339
l2.5 islower, isupper iswlower, iswupper 340
l2.6 isblank, isspace, iswhite, iswspace 34l
l2.7 toascii 34l
l2.8 toint 342
l2.9 tolower, toupper, towlower, towupper 342
l2.l0 wctype_t, wctype, iswctype 343
l2. ll wctrans_t, wctrans 344
13 String Processing 347
l3.l stroat, strncat, wcscat, wcsncat 348
l3.2 strcmp, strncmp, wcscmp, wcsncmp 349
l3.3 strcpy, strncpy, wcscpy, wcsncpy 350
l3.4 strlen, wcslen 35l
l3.5 strehr, strrchr, wcschr, wcsrchr 351
l3.6 strspn, strcspn, strpbrk, strrpbrk, wcsspn, wcscspn, wcspbrk 352
l3.7 strstr strtok, wcsstr wcstok 354
l3.8 strtod, sotof, strtold, strtol, strtoll, strttoul, strtoull 355
l3.9 atof, atoi, atol, atoll 356
l3.l0 streoll, strxfrm, wcscoll, wcsxfrm 356
14 Memory Functions 359
14.1 memchr, wmemchr 359
l4.2 memcmp, wmemcmp 360
l4.3 memcpy, memccpy memmove, wmemcpy, wmemmove 36l
l4.4 memset, wmemset 362
l5 Input/output Facilities 363
l5.l FILE, EOF, wchar_t, wint_t, WEOF 365
l5.2 fopen, fclose, mush, freopen, fwide 366
l5.3 setbuf, setvbuf 370
l5.4 stdin, stdout, stderr 37l
l5.5 fseek, ftell, rewind, fgetpos, fsetpos 372
l5.6 fgetc, fgetwc, getc, getwc, getchar getwchar, ungetc, ungetwc 374
l5.7 fgets, fgetws, gets 376
l5.8 fscanf, fwscanf, scanf, wscanf, sscanf, swscanf 377
l5.9 fputc, fputwc, putc, putwc, putchar, putwchar 385
l5.l0 fputs, fputws, puts 386
l5.l l fprintf, printf, sprint f, snprintf, fwprintf, wprintf, swprintf 387
l5.l2 v[x]prrintf, v[x]scanf 40l
l5.l3 fread, fwrite 402
l5.l4 feof, fermr, clearerr 404
l5.l5 remove, rename 404
l5.l6 tmpfile, tmpnam, mktemp 405
l6 General Utilities 407
l6.l malloc, calloc, mlalloc, clalloc, free, cfree 407
l6.2 rand, srand, RAND_NAX 4l0
l6.3 atof, atoi, atol, atoll l 4ll
l6.4 strtod, strtof, strtold, strtol, strtoll, strtoul, strtoull 4l2
l6.5 abort, atexit, exit, _Exit, EXIT_FAILURE, EXIT_SUCCESS 4l4
l6.6 getenv 4l5
l6.7 system 4l6
l6.8 bsearch, qsort 4l7
l6.9 abs, labs, llabs, div, ldiv, lldiv 4l9
l6.l0 mblen, mbtowc, wctomb 420
l6.ll mbstowcs, wcstombs 422
17 Mathematical Functions 425
l7.l abs, labs, llabs, div ldiv, lldiv 426
l7.2 fabs 426
l7.3 ceil, floor, lrint, llrint, lround, llround, nearbyint, round, rint,trunc 427
l7.4 fmod, remainder, remquo 428
l7.5 frexp, ldexp, modf, scalbn 429
l7.6 exp, exp2, expml, ilogb, log, logl0, loglp, log2, logb 430
l7.7 cbrt, fma, hypot, pow, sqrt 432
l7.8 rand, srand, RAND_MAX 432
l7.9 cos, sin, tan, cosh, sinh, tanh 433
l7. l0 acos, asin, atan, atan2, acosh, asinh, atanh 434
l7.ll fdim, fmax, fmin 435
l7. l2 Type-Generic Macros 435
l7. l3 erf, erfc, lgamma, tgamma 439
l7. l4 fpelassify, isfinite, isinf, isnan, isnormal, signbit 440
l7. l5 copysign, nan, nextafer, nexttoward 441
l7. l6 isgreater, isgreaterequal, isless, islessequal, islessgreater,isunordered 442
l8 Time and Date Functions 443
l8. l clock, clock_t, CLOCKS_PER_SEC, times 443
l8.2 time, time_t 445
l8.3 asctime, ctime 445
l8.4 gmtime, localtime, mktime 446
l8.5 difftime 447
l8.6 strftime, wcsftime 448
19 Control Functions 453
l9.l assert, NDEBUG 453
l9.2 system, exec 454
19.3 exit, aboIt 454
l9.4 set jmp, longimp,jmp_buf 454
l9.5 atexit 456
l9.6 signal, raise, gsignal, ssignal, psignal 456
l9.7 sleep, alarm 458
20 Locale 461
20.l setlocale 46l
20.2 localeconv 463
2l Extended Integer Types 467
2l. l General Rules 467
2l.2 Exact-Size Integer Types 470
2l.3 Least-Size Types of a Minimum Width 47l
2l.4 Fast Types of a Minimum Width 472
2l.5 Pointer-Size and Maximum-Size Integer Types 473
2l.6 Ranges of ptrdiff_t, size_t, wchap_t, wint_t, and sig_atomic_t 474
2l.7 imaxabs, imaxdiv, imaxdiv_t 474
2l.8 strtoimax, strtouimax 475
2l.9 wcstoimax, wcstoumax 475
22 Floating-Point Environment 477
22.l Overview 477
22.2 Floating-Point Environment 478
22.3 Floating-Point Exceptions 479
22.4 Floating-Point Rounding Modes 48l
22'5 Floating-Point Expression Contraction 48l
23 Complex Arithmetic 483
23.l Complex Library Conventions 483
23.2 complex, _Complex_I, imaginary, _Imaginary_I, I 484
23.3 CX_LIMITED_RANGE 484
23.4 cacos, casin, catan, ccos, csin, ctan 485
23.5 cacosh, casinh, catanh, ccosh, csinh, ctanh 486
23.6 cexp, clog, cabs, cpow csqrt 487
23.7 carg, cimag, creal, conj, cproj 488
24 Wide and Multibyte Facilities 489
24.l Basic rypes and Macros 489
24.2 Conversions Between Wide and Multibyte Characters 490
24.3 Conversions Between Wide and Multibyte Strings 49l
24.4 Conversions to Arithmetic Types 493
24.5 Input and Output Functions 493
猜您喜欢