Book description
Learning a language--any language--involves a process wherein you learn to rely less and less on instruction and more increasingly on the aspects of the language you've mastered. Whether you're learning French, Java, or C, at some point you'll set aside the tutorial and attempt to converse on your own. It's not necessary to know every subtle facet of French in order to speak it well, especially if there's a good dictionary available. Likewise, C programmers don't need to memorize every detail of C in order to write good programs. What they need instead is a reliable, comprehensive reference that they can keep nearby. C in a Nutshell is that reference.
This long-awaited book is a complete reference to the C programming language and C runtime library. Its purpose is to serve as a convenient, reliable companion in your day-to-day work as a C programmer. C in a Nutshell covers virtually everything you need to program in C, describing all the elements of the language and illustrating their use with numerous examples.
The book is divided into three distinct parts. The first part is a fast-paced description, reminiscent of the classic Kernighan & Ritchie text on which many C programmers cut their teeth. It focuses specifically on the C language and preprocessor directives, including extensions introduced to the ANSI standard in 1999. These topics and others are covered:
- Numeric constants
- Implicit and explicit type conversions
- Expressions and operators
- Functions
- Fixed-length and variable-length arrays
- Pointers
- Dynamic memory management
- Input and output
The second part of the book is a comprehensive reference to the C runtime library; it includes an overview of the contents of the standard headers and a description of each standard library function. Part III provides the necessary knowledge of the C programmer's basic tools: the compiler, the make utility, and the debugger. The tools described here are those in the GNU software collection.
C in a Nutshell is the perfect companion to K&R, and destined to be the most reached-for reference on your desk.
Publisher resources
Table of contents
- C in a Nutshell
- Preface
-
I. Language
- 1. Language Basics
- 2. Types
- 3. Literals
-
4. Type Conversions
- 4.1. Conversion of Arithmetic Types
- 4.2. Conversion of Nonarithmetic Types
-
5. Expressions and Operators
- 5.1. How Expressions Are Evaluated
- 5.2. Operators in Detail
- 5.3. Constant Expressions
- 6. Statements
- 7. Functions
- 8. Arrays
- 9. Pointers
-
10. Structures and Unions and Bit-Fields
-
10.1. Structures
- 10.1.1. Defining Structure Types
- 10.1.2. Structure Objects and typedef Names
- 10.1.3. Incomplete Structure Types
- 10.1.4. Accessing Structure Members
- 10.1.5. Initializing Structures
- 10.1.6. Initializing Specific Members
- 10.1.7. Structure Members in Memory
- 10.1.8. Flexible Structure Members
- 10.1.9. Pointers as Structure Members
- 10.2. Unions
- 10.3. Bit-Fields
-
10.1. Structures
- 11. Declarations
- 12. Dynamic Memory Management
- 13. Input and Output
- 14. Preprocessing Directives
-
II. Standard Library
-
15. The Standard Headers
- 15.1. Using the Standard Headers
-
15.2. Contents of the Standard Headers
- 15.2.1. assert.h
- 15.2.2. complex.h
- 15.2.3. ctype.h
- 15.2.4. errno.h
- 15.2.5. fenv.h
- 15.2.6. float.h
- 15.2.7. inttypes.h
- 15.2.8. iso646.h
- 15.2.9. limits.h
- 15.2.10. locale.h
- 15.2.11. math.h
- 15.2.12. setjmp.h
- 15.2.13. signal.h
- 15.2.14. stdarg.h
- 15.2.15. stdbool.h
- 15.2.16. stddef.h
- 15.2.17. stdint.h
- 15.2.18. stdio.h
- 15.2.19. stdlib.h
- 15.2.20. string.h
- 15.2.21. tgmath.h
- 15.2.22. time.h
- 15.2.23. wchar.h
- 15.2.24. wctype.h
-
16. Functions at a Glance
- 16.1. Input and Output
- 16.2. Mathematical Functions
- 16.3. Character Classification and Conversion
- 16.4. String Processing
- 16.5. Multibyte Characters
- 16.6. Converting Between Numbers and Strings
- 16.7. Searching and Sorting
- 16.8. Memory Block Handling
- 16.9. Dynamic Memory Management
- 16.10. Date and Time
- 16.11. Process Control
- 16.12. Internationalization
- 16.13. Nonlocal Jumps
- 16.14. Debugging
- 16.15. Error Messages
-
17. Standard Library Functions
- _Exit C99
- abort
- abs
- acos
- acosh C99
- asctime
- asin
- asinh C99
- assert
- atan
- atan2
- atanh C99
- atexit
- atof
- atoi
- atol, atoll
- bsearch
- btowc
- cabs C99
- cacos C99
- cacosh C99
- calloc
- carg C99
- casin C99
- casinh C99
- catan C99
- catanh C99
- cbrt C99
- ccos C99
- ccosh C99
- ceil
- cexp C99
- cimag C99
- clearerr
- clock
- conj C99
- copysign C99
- cos
- cosh
- cpow C99
- cproj C99
- creal C99
- csin C99
- csinh C99
- csqrt C99
- ctan C99
- ctanh C99
- ctime
- difftime
- div
- erf C99
- erfc C99
- exit
- exp
- exp2 C99
- expm1 C99
- fabs
- fclose
- fdim C99
- feclearexcept C99
- fegetenv C99
- fegetexceptflag C99
- fegetround C99
- feholdexcept C99
- feof
- feraiseexcept C99
- ferror
- fesetenv C99
- fesetexceptflag C99
- fesetround C99
- fetestexcept C99
- feupdateenv C99
- fflush
- fgetc
- fgetpos
- fgets
- fgetwc
- fgetws
- floor
- fma C99
- fmax C99
- fmin C99
- fmod
- fopen
- fpclassify C99
- fprintf
- fputc
- fputs
- fputwc
- fputws
- fread
- free
- freopen
- frexp
- fscanf
- fseek
- fsetpos
- ftell
- fwide
- fwprintf
- fwscanf
- fwrite
- getc
- getchar
- getenv
- gets
- getwc
- getwchar
- gmtime
- hypot C99
- ilogb C99
- imaxabs C99
- imaxdiv C99
- isalnum
- isalpha
- isblank C99
- iscntrl
- isdigit
- isfinite C99
- isgraph
- isgreater, isgreaterequal C99
- isinf C99
- isless, islessequal, islessgreater C99
- islower
- isnan C99
- isnormal C99
- isprint
- ispunct
- isspace
- isunordered C99
- isupper
- iswalnum
- iswalpha
- iswblank C99
- iswcntrl
- iswctype
- iswdigit
- iswgraph
- iswlower
- iswprint
- iswpunct
- iswspace
- iswupper
- iswxdigit
- isxdigit
- labs
- ldexp
- ldiv
- llabs C99
- lldiv C99
- llrint
- llround
- localeconv
- localtime
- log
- log10
- log1p C99
- log2 C99
- logb C99
- longjmp
- lrint C99
- lround C99
- malloc
- mblen
- mbrlen
- mbrtowc C99
- mbsinit
- mbsrtowcs
- mbstowcs
- mbtowc
- memchr
- memcmp
- memcpy
- memmove
- memset
- mktime
- modf
- nearbyint C99
- nextafter C99
- nexttoward C99
- perror
- pow
- printf
- putc
- putchar
- puts
- putwc
- putwchar
- qsort
- raise
- rand
- realloc
- remainder C99
- remove
- remquo C99
- rename
- rewind
- rint C99
- round C99
- scalbln, scalbn C99
- scanf
- setbuf
- setjmp
- setlocale
- setvbuf
- signal
- signbit C99
- sin
- sinh
- snprintf
- sprintf
- sqrt
- srand
- sscanf
- strcat
- strchr
- strcmp
- strcoll
- strcpy
- strcspn
- strerror
- strftime
- strlen
- strncat
- strncmp
- strncpy
- strpbrk
- strrchr
- strspn
- strstr
- strtod, strtof, strtold
- strtoimax C99
- strtok
- strtol, strtoll
- strtoul, strtoull
- strtoumax C99
- strxfrm
- swprintf
- swscanf
- system
- tan
- tanh
- time
- tmpfile
- tmpnam
- tolower
- toupper
- towctrans
- towlower
- towupper
- trunc C99
- ungetc
- ungetwc
- va_arg, va_copy, va_end, va_start
- vfprintf, vprintf, vsnprintf, vsprintf
- vfscanf, vscanf, vsscanf
- vfwprintf, vswprintf, vwprintf
- vfwscanf, vswscanf, vwscanf
- wcrtomb
- wcscat
- wcschr
- wcscmp
- wcscoll
- wcscpy
- wcscspn
- wcsftime
- wcslen
- wcsncat
- wcsncmp
- wcsncpy
- wcspbrk
- wcsrchr
- wcsrtombs
- wcsspn
- wcsstr
- wcstod, wcstof, wcstold
- wcstoimax C99
- wcstok
- wcstol, wcstoll
- wcstold
- wcstoll
- wcstombs
- wcstoul, wcstoull
- wcstoumax C99
- wcsxfrm
- wctob
- wctomb
- wctrans
- wctype
- wmemchr
- wmemcmp
- wmemcpy
- wmemmove
- wmemset
- wprintf
- wscanf
-
15. The Standard Headers
-
III. Basic Tools
-
18. Compiling with GCC
- 18.1. The GNU Compiler Collection
- 18.2. Obtaining and Installing GCC
- 18.3. Compiling C Programs with GCC
- 18.4. C Dialects
- 18.5. Compiler Warnings
- 18.6. Optimization
- 18.7. Debugging
- 18.8. Profiling
- 18.9. Option and Environment Variable Summary
- 19. Using make to Build C Programs
-
20. Debugging C Programs with GDB
- 20.1. Installing GDB
- 20.2. A Sample Debugging Session
- 20.3. Starting GDB
-
20.4. Using GDB Commands
- 20.4.1. Command Completion
- 20.4.2. Displaying Help for Commands
- 20.4.3. Status Information
- 20.4.4. Running a Program in the Debugger
- 20.4.5. Displaying Source Code
- 20.4.6. Working with Breakpoints
- 20.4.7. Resuming Execution After a Break
- 20.4.8. Analyzing the Stack
- 20.4.9. Displaying Data
- 20.4.10. Watchpoints: Observing Operations on Variables
- 20.4.11. Analyzing Core Files in GDB
-
18. Compiling with GCC
- Index
- About the Authors
- Colophon
- Copyright
Product information
- Title: C in a Nutshell
- Author(s):
- Release date: December 2005
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596006976
You might also like
book
C in a Nutshell, 2nd Edition
The new edition of this classic O’Reilly reference provides clear, detailed explanations of every feature in …
book
Extreme C
Push the limits of what C - and you - can do, with this high-intensity guide …
book
Head First C
Ever wished you could learn C from a book? Head First C provides a complete learning …
book
Fluent C
Expert advice on C programming is hard to find. While much help is available for object-oriented …