harbison s p steele g l c a reference manual 5th ed

551

Upload: allan-leite

Post on 29-Sep-2015

105 views

Category:

Documents


1 download

DESCRIPTION

Um guia de referência para a linguagem de programação c

TRANSCRIPT

  • CoverContentsList of TablePrefecPARRT 1 The C Language1 Introduction1.1 The Evolution of C1.2 Which Dialect of C Should You Use?1.3 An Overview of C Programming1.4 Conformance1.5 Syntax Notation

    2 LexicaIElements2.1 Character Set2.2 Comments2.3 Tokens2.40 perators and Separators2.5 Identifiers2.6 Keywords2.7 Constants2.8 C++Compatibility2.90 n Character Sets,Repertoires,and Encodings2.10 Exercises

    3 The C Preprocessor3.1 Preprocessor Commands3.2 Preprocessor Lexical Conventions3.3 Definition and Replacement3.4 Filelnclusion3.5 ConditionalCompilation3.6 Explicit Line Numbering3.7 PragmaDirective3.8 Error Directive3.9 C++Compatibility3.10 Exercises

    4 Declarations4.10 rganization of Declarations4.2 Terminology4.3 Storage Class and Function Specifiers4.4 Type Specifiers and Qualifiers4.5 Declarators4.6 Initializers4.7 Implicit Declarations4.8 ExternalNames4.9 C++Compatibility4.10 Exercises

    5 Types5.1 IntegerTypes5.2 Floating-PointTypes5.3 PointerTypes5.4 Array Types5.5 Enumerated Types5.6 StructureTypes5.7 Union Types5.8 Function Types5.9 The Void Type5.10 TypedefNames5.11 Type Compatibility5.12 Type Names and Abstract Declarators5.13 C++Compatibility5.14 Exercises

    6 Converslons and Representations6.1 Representations6.2 Conversions6.3 The Usual Conversions6.4 C++Compatibility6.5 Exercises

    7 Expressions7.10 bjects,Lvalues,and Designators7.2 Expressions and Precedence7.3 Primary Expressions7.4 Postfix Expressions7.5 UnaryExpressions7.6 Binary Operator Expressions7.7 Logical Operator Expressions7.8 ConditionalExpressions7.9 Assignment Expressions7.10 SequentialExpressions7.11 ConstantExpressions7.120 rder of Evaluation7.13 Discarded Values7.140 ptimization of Memory Accesses7.15 C++Compatibilitv7.16 Exercises

    8 Statements8.1 General Syntactic Rules for Statements8.2 Expression Statements8.3 Labeled Statements8.4 Compound Statements8.5 ConditionalStatements8.6 Iterative Statements8.7 Switch Statements8.8 Break and Continue Statements8.9 Return Statements8.10 Goto Statements8.11 Null Statements8.12 C++Compatibility8.13 Exercises

    9 Functions9.1 Function Definitions9.2 Function Prototypes9.3 Formal Parameter Declarations9.4 Adjustments to Parameter Types9.5 Parameter-Passing Conventions9.6 Agreement of Parameters9.7 Function Return Types9.8 Agreement of Return Types9.9 The Main Program9.10 Inline Functions9.11 C++Compatibility9.12 Exercises

    PART 2 The C Libraries10 Introduction to the Libraries10.1 Standard C Facilities10.2 C++Compatibility10.3 Library Headers and Names

    11 Standard Language Additions11.1 NULL,ptrdiff_t,size_t,offsetof11.2 EDOM,ERANGE,EILSEQ,errno,strerror,perror11.3 bool,false,true11.4 va_list,va_start,va_arg,va_end11.5 Standard C Operator Macros

    12 Character Processing12.1 isalnum,isalpha,iscntrl,iswalnum,iswalpha,iswcntrl12.2 iscsym,iscsymf12.3 isdigit,isodigit,isxdigit,iswdigit,iswxdigit12.4 isgraph,isprint,ispunct,iswgraph,iswprint,iswpunct12.5 islower,isupper,iswlower,iswupper12.6 isblank,isspace,iswhite,iswspace12.7 toascii12.8 toint12.9 tolower,toupper,towlower,towupper12.10 wctype_t,wctype,iswctype12.11 wctrans_t,wctrans

    13 String Processing13.1 strcat,strncat,wcscat,wcsncat13.2 strcmp,strncmp,wcscmp,wcsncmp13.3 strcpy,strncpy,wcscpy,wcsncpy13.4 strlen,wcslen13.5 strchr,strrchr,wcschr,wcsrchr13.6 strspn,strcspn,strpbrk,strrpbrk,wcsspn,wcscspn,wcspbrk13.7 strstr,strtok,wcsstr,wcstok13.8 strtod,strtof,strtold,strtol,strtoll,strtoul,strtoull13.9 atof,atoi,atol,atoll13.10 strcoll,strxfrm,wcscoll,wcsxfrm

    14 Memory Functions14.1 memchr,wmemchr14.2 memcmp,wmemcmp14.3 memcpy,memccpy,memmove,wmemcpy,wmemmove14.4 memset,wmemset

    15 Input/Output Facilities15.1 FILE,EOF,wchar_t,wint_t,WEOF15.2 fopen,fclose,fflush,freopen,fwide15.3 setbuf,setvbuf15.4 stdin,stdout,stderr15.5 fseek,ftell,rewind,fgetpos,fsetpos15.6 fgetc,fgetwc,getc,getwc,getchar,getwchar,ungetc,ungetwc15.7 fgets,fgetws,gets15.8 fscanf,fwscanf,scanf,wscanf,sscanf,swscanf15.9 fputc,fputwc,putc,putwc,putchar,putwchar15.10 fputs,fputws,puts15.11 fprintf,printf,sprintf,snprintf,fwprintf,wprintf,swprintf15.12 vfprintf,vfwprintf,vprintf,vwprintf,vsprintf,vswprintf,vfscanf,vfwscanf,vscanf,vwscanf,vsscanf,vswscanf15.13 fread,fwrite15.14 feof,ferror,clearerr15.15 remove,rename15.16 tmpfile,tmpnam,mktemp

    16 GeneraIUtilities16.1 malloc,calloc,mlalloc,clalloc,free,cfree16.2 rand,srand,RAND_MAX16.3 atof,atoi,atol,atoll16.4 strtod,strtof,strtold,strtol,strtoll,strtoul,strtoull16.5 abort,atexit,exit,_Exit,EXIT_FAILURE,EXIT_SUCCESS16.6 getenv16.7 system16.8 bsearch,qsort16.9 abs,labs,llabs,div,ldiv,lldiv16.10 mblen,mbtowc,wctomb16.11 mbstowcs,wcstombs

    17 MathematicaIFunctions17.1 abs,labs,llabs,div,ldiv,lldiv17.2 fabs17.3 ceil,floor,lrint,llrint,lround,llround,nearbyint,round,rint,trunc17.4 fmod,remainder,remqu017.5 frexp,ldexp,modf,scalbn17.6 exp,exp2,expml,ilogb,log,logl0,loglp,log2,logb17.7 cbrt,fma,hypot,pow,sqrt17.8 rand,srand,RAND_MAX17.9 cos,sin,tan,cosh,sinh,tanh17.10 acos,asin,atan,atan2,acosh,asinh,atanh17.11 fdim,fmax,fmin17.12 Type-Generic Macros17.13 erf,erfc,lgamma,tgamma17.14 fpclassify,isfinite,isinf,isnan,isnormal,signbit17.15 copysign,nan,nextafter,nexttoward17.16 isgreater,isgreaterequal,isless,islessequal,islessgreater,isunordered

    18 Time and Date Functions18.1 clock,clock_t,CLOCKS_PER_SEC,times18.2 time,time_t18.3 asctime,ctime18.4 gmtime,localtime,mktime18.5 difftime18.6 strftime,wcsftime

    19 ControIFunctions19.1 assert,NDEBUG19.2 system,exec19.3 exit,abort19.4 setjmp,longjmp,jmp_buf19.5 atexit19.6 signal,raise,gsignal,ssignal,psignal19.7 sleep,alarm

    20 Locale20.1 setlocale20.2 localeconv

    21 Extended Integer Types21.1 GeneralRules21.2 Exact-SizeIntegerTypes21.3 Least-Size Types of a Minimum Width21.4 Fast Types of a Minimum Width21.5 Pointer-Size and Maximum-Sizelnteger Types21.6 Ranges of ptrdiff_t,size_t,wchar_t,wint_t,and sig_atomic_t21.7 imaxabs,imaxdiv,imaxdiv_t21.8 strtoimax,strtouimax21.9 wcstoimax,wcstoumax

    22 Floating-Point Environment22.10 verview22.2 Floating-PointEnvironment22.3 Floating-PointExceptions22.4 Floating-Point Rounding Modes

    23 Complex Arithmetic23.1 Complex Library Conventions23.2 complex,_Complex_l,imaginary,_Imaginary_l23.3 CX_LIMITED_RANGE23.4 cacos,casin,catan,ccos,csin,ctan23.5 cacosh,casinh,catanh,ccosh,csinh,ctanh23.6 cexp,clog,cabs,cpow,csqrt23.7 carg,cimag,creal,conj,cproj

    24 Wide and Multibyte Facilities24.1 Basic Types and Macros24.2 Conversions Between Wide and Multibyte Characters24.3 Conversions Between Wide and Multibyte Strings24.4 Conversions to Arithmetic Types24.5 Input and Output Functions24.6 String Functions24.7 Date and Time Conversions24.8 Wide-Character Classification and Mapping Functions

    A The ASCII Character SetB SyntaxC Answers to the ExercisesIndex