C in a Nutshell: The Definitive Reference
Peter Prinz, Tony Crawford
Format: PDF / Kindle (mobi) / ePub
The new edition of this classic O’Reilly reference provides clear, detailed explanations of every feature in the C language and runtime library, including multithreading, type-generic macros, and library functions that are new in the 2011 C standard (C11). If you want to understand the effects of an unfamiliar function, and how the standard library requires it to behave, you’ll find it here, along with a typical example.
Ideal for experienced C and C++ programmers, this book also includes popular tools in the GNU software collection. You’ll learn how to build C programs with GNU Make, compile executable programs from C source code, and test and debug your programs with the GNU debugger.
In three sections, this authoritative book covers:
- C language concepts and language elements, with separate chapters on types, statements, pointers, memory management, I/O, and more
- The C standard library, including an overview of standard headers and a detailed function reference
- Basic C programming tools in the GNU software collection, with instructions on how use them with the Eclipse IDE
type-generic macros are described in the section on tgmath.h in Chapter 15. Categories of floating-point values C99 defines five kinds of values for the real floating-point types, with distinct integer macros to designate them (see the section on math.h in Chapter 15): FP_ZERO FP_NORMAL FP_SUBNORMAL FP_INFINITE FP_NAN These classification macros, and the function-like macros listed in Table 16-7, are defined in the header math.h. The argument of each of the function-like macros must
vprintf(), vfprintf(), vsprintf(), and vsnprintf(); the printf() functions for wide characters that use the type va_list for the variable arguments, vwprintf(), vfwprintf(), and vswprintf(); the formatted input functions scanf(), sscanf(), and fscanf() Name putc Synopsis Writes a character to a file #include
same rank as its corresponding integer type (see "Enumerated Types" in Chapter 2). The floating-point types are ranked in the following order: float < double < long double The lowest-ranked floating-point type, float, has a higher rank than any integer type. Every complex floating-point type has the same rank as the type of its real and imaginary parts. Integer Promotion In any expression, you can always use a value whose type ranks lower than int in place of an operand of
object files in the project like this: %.o: %.c $(CC) $(CFLAGS) -o $@ -c $< And if a certain object needs to be handled differently for some reason, you can put a static pattern rule for that object file in the makefile as well. make then applies the static rule for targets explicitly named in it, and the implicit rule for all other .o files. Also, make refrains from announcing an error if any object file's implicit prerequisite does not exist. The percent sign is usually used only once in
comma operator) Thus the expression ++i < 100 ? f(i++) : (i = 0) is permissible, as there is a sequence point between the first modification of i and whichever of the other two modifications is performed. Operator Precedence and Associativity An expression may contain several operators. In this case, the precedence of the operators determines which part of the expression is treated as the operand of each operator. For example, in keeping with the customary rules of arithmetic, the