What you will learn in Modern C, Third Edition
Covers the C23 standard
Chapter by chapter
Chapter 1: Getting started
This introduction frames C programming as giving a computer instructions to carry out specific tasks.
What you learn in chapter 1 →Chapter 2: The principal structure of a program
The introduction connects earlier C examples to larger programs and distinguishes a program’s syntax from its semantic parts.
What you learn in chapter 2 →Chapter 3: Everything is about control
This introduction contrasts unconditional function calls and returns with conditional control statements, then identifies the roles of C’s five conditional statements.
What you learn in chapter 3 →Chapter 4: Expressing computations
Introduces C expressions as code that computes values and distinguishes arithmetic expressions from comparisons.
What you learn in chapter 4 →Chapter 5: Basic values and data
The chapter introduces the distinction between C values and their representations, and presents the abstract state machine as a platform-independent way to reason about program state.
What you learn in chapter 5 →Chapter 6: Derived data types
Introduces four ways C derives data types from basic types and distinguishes them from typedef, which gives an existing type a new name.
What you learn in chapter 6 →Chapter 7: Functions
The chapter introduction contrasts conditional and unconditional control transfer and explains why functions are useful for organizing C programs.
What you learn in chapter 7 →Chapter 8: C library functions
Introduces the C library as a portable set of everyday programming tools and explains how its specified API can separate compiler and library implementations.
What you learn in chapter 8 →Chapter 9: Style
The chapter introduces readability as a requirement for C code and explains how human limits and project culture shape coding style.
What you learn in chapter 9 →Chapter 10: Organization and documentation
This introduction explains why useful documentation distinguishes an interface’s purpose from its implementation details and why code and comments should each contribute meaningful information.
What you learn in chapter 10 →Chapter 11: Pointers
The chapter introduces pointers as references to other objects and shows how they let a function change objects belonging to its caller.
What you learn in chapter 11 →Chapter 12: The C memory model
Introduces the C memory model as an abstraction for accessing objects through pointers, while establishing the roles of pointer types and byte-based object representations.
What you learn in chapter 12 →Chapter 13: Storage
The introduction contrasts the lifetimes of previously encountered objects with storage instances created by recursive calls and dynamic allocation.
What you learn in chapter 13 →Chapter 14: More involved processing and I/O
The introduction connects the chapter’s text-processing and formatted-input topics to the pointer concepts covered earlier.
What you learn in chapter 14 →Chapter 15: Program failure
The introduction frames program failure around its causes, sketches three ways failures arise, and limits the chapter’s scope to failures that manifest during execution.
What you learn in chapter 15 →Chapter 16: Performance
The chapter introduction argues for safe, relevant performance work and explains how programmers can give C compilers useful optimization information.
What you learn in chapter 16 →Chapter 17: Function-like macros
The chapter introduction explains why inline functions are usually safer than function-like macros, while identifying when macros remain useful.
What you learn in chapter 17 →Chapter 18: Type-generic programming
The introduction shows that C already has widespread type-generic features, then contrasts the fixed-type limits of _Generic with C23 type inference.
What you learn in chapter 18 →Chapter 19: Variations in control flow
Introduces basic blocks and structured control flow, then explains why less predictable changes in control flow make program state harder to reason about.
What you learn in chapter 19 →Chapter 20: Threads
Introduces threads as concurrent control flows through the B9 game, then shows how C starts, runs, and joins its task threads.
What you learn in chapter 20 →Chapter 21: Atomic access and memory consistency
The introduction frames memory consistency in terms of concurrent access, effects on a program’s abstract state, and the limits of a single timeline across threads.
What you learn in chapter 21 →Chapter 22: Technical annex
This introduction explains when C23 toolchain support or differences from the author’s development environment may limit the annex’s usefulness.
What you learn in chapter 22 →Concepts explained in this book
- volatile qualificationThe C volatile qualifier specifies that accesses to an object may have externally observable effects and must not be treated as freely eliminable or cacheable by the compiler.
- atomic typeA type specifies the kind of values an entity can represent and the operations applicable to those values.
- floating-point arithmeticA floating-point value is a finite-precision numerical value represented by a sign, an exponent, and a sequence of significand bits.
- referenceA pointer type is a C type whose values designate objects or functions in storage.
- code pointA code point is a numeric value identifying a character or abstract symbol in a character repertoire such as Unicode.
- stopping criterionA condition is an expression whose evaluated value controls conditional or iterative execution in C.
- integerAn integer type is a C type whose values represent whole numbers, with either signed or unsigned representation.
- attributeAn attribute is supplemental implementation or semantic information attached to a C program construct.
- lockingA mutex is a mutual-exclusion synchronization object that allows only one thread at a time to hold a protected critical section.
- performancePerformance is the measurable efficiency of a program or operation, commonly including execution time and resource consumption.
- UnicodeUnicode is a universal character encoding standard that assigns code points and properties to characters and symbols across writing systems.
- threadA thread of execution is an independently schedulable sequence of program operations within a running program.
- inline functioninline is a C function specifier that permits a definition to suggest inline substitution of a function's body at call sites without requiring the compiler to perform that substitution.
- exceptionAn exception is an abnormal execution condition that can interrupt ordinary computation and potentially terminate a program.
- signalAn asynchronous signal is an externally generated notification delivered to a running program independently of its current instruction sequence.
- type-generic macroA type-generic statement is a statement-form macro expansion whose operations can adapt to the types of its arguments or associated objects.
- signal handlerA signal handler is a function invoked in response to a signal raised by an execution environment or program.
- timespec_gettimespec_get is a C standard-library function that obtains the current calendar time and stores it in a timespec object.
- identifierAn identifier is a programmer-defined name that denotes a program entity such as a variable, function, or parameter.
- lifetimeAn object's lifetime is the interval of program execution during which the object exists and can be accessed according to the language rules.
- string_literalstring_literal is a book-specific function-like macro that accepts a string literal by requiring adjacent empty string literals in its replacement.
- pure functionA pure function is a function whose interactions with the rest of a program occur only through its interface and whose behavior has no other observable effects.
- automatic storageAutomatic storage duration is a C storage duration in which an object's storage is created on entry to a relevant block or function and released when execution leaves it.
- type-generic interfaceType-generic programming is a programming technique that selects or adapts operations according to the types of values involved.
- loopA for statement is a C iteration statement that controls repeated execution using initialization, a continuation condition, and an iteration expression.
- function-like macroA function-like macro is a C preprocessor macro invoked with parentheses and arguments that expands its invocation into replacement source text.
- reproducible attributeThe reproducible attribute is a C23 function attribute declaring that a call produces consistent results and effects for given arguments while permitting limited temporary state changes.
- unsequenced attributeThe unsequenced attribute is a C function attribute indicating that calls to the function can be treated as unsequenced with respect to relevant evaluation and side-effect rules.
- binary representationA binary representation is an abstract, platform-specific model of the values of a C type that determines the results of operations on those values.
- reallocrealloc is a C library function that changes the size of an allocated storage region while preserving its existing contents up to the applicable size.
- setlocalesetlocale is a C standard-library function that selects or queries the program's current locale for locale-sensitive behavior.
- format stringA format string is a character sequence containing literal text and format specifiers that controls formatted output conversion.
- precisionPrecision is the number of significant binary digits available to represent a floating-point value in the C standard's restricted sense.
- program failureProgram failure is execution that can no longer be relied upon because the program has entered a state resulting from undefined behavior.
- multibyte stringA multibyte string is a character sequence in which one logical character may occupy multiple bytes according to the active C locale encoding.
- condition variableA condition variable is a thread-synchronization object that allows threads to wait until a shared-state condition may have become true.
- synchronizationA synchronization event is an operation or occurrence that coordinates concurrent execution and can establish an ordering relationship between threads.
- setjmp/longjmpA long jump is a nonlocal control transfer that can move execution across function-call boundaries.
- sig_atomic_tsig_atomic_t is an integer type whose object evaluation and assignment operations are guaranteed to be indivisible with respect to signal handling.
- stateHidden state is implementation or library state that affects program behavior without being directly represented by ordinary program values.
- character literalA character literal is a C source-code literal enclosed in single quotes that represents an integer character code.
- indexingArray indexing is the C operation of selecting an array element with an index expression, such as A[i].
- localeA locale is a set of language- and culture-dependent conventions governing the interpretation and presentation of textual and numeric data.
- gotogoto is a C jump statement that transfers execution to a labeled statement within the same function.
- callA function call is an expression or statement that requests execution of a function with supplied arguments.
- cnd_timedwaitcnd_timedwait is a C threads-library function that atomically releases a mutex while waiting for a condition variable and returns when signaled or when an absolute time limit is reached.
- mbstate_tmbstate_t is the C standard-library type that represents the conversion state required by restartable multibyte character functions.
- mallocmalloc is a C library function that allocates a specified number of bytes of uninitialized storage and returns a pointer to it or a null pointer on failure.
- measurementA measurement is an observed quantitative value obtained from a program execution or other empirical process.
- aliasingAliasing is the situation in which multiple pointer expressions or access paths designate the same object or overlapping storage.
- prototypeA function prototype is a declaration that specifies a function's name, return type, and parameter types without providing its body.
- automatic objectAn automatic variable is a C object with automatic storage duration, normally created on entry to a block and destroyed on exit from it.
- _GenericA generic selection is a C11 expression construct that selects one expression from a set based on the type of a controlling expression.
- abstract state machineAn abstract computational model that describes program execution through states and state transitions independently of a particular machine implementation.
- storage durationStorage duration is the lifetime category that determines when a C object is created, exists, and is initialized or destroyed.
- performance optimizationOptimization is the transformation of a program's implementation to improve execution or compilation while preserving its required observable behavior.
- undefined behaviorUndefined behavior is a C execution condition for which the standard imposes no requirements on the program's subsequent behavior.
- unsigned integerunsigned int is a C unsigned integer type that represents nonnegative whole numbers within an implementation-defined range.
- preconditionA platform precondition is a required property or capability of the execution environment that must hold for code to be valid or executable.
- literalA literal is source text that denotes a fixed value directly in a C program.
- arrayAn array is an aggregate object containing a fixed sequence of items of the same type, accessed by numeric indices.
- declarationA C declaration specifies the kind of entity an identifier refers to without necessarily allocating storage or supplying its concrete value.
- asynchronous signal safe functionAn asynchronous signal-safe function is a function permitted to execute in an asynchronous signal handler without uncontrolled access to program state.
- interruptA hardware interrupt is an execution event caused synchronously by a processor-detected fault or hardware condition.
- lockless techniqueThe lock-free property indicates that operations on an atomic type do not require a hidden lock and are indivisible with respect to signal interruption.
- signal dispositionA signal disposition is the action configured for a particular signal when that signal is delivered.
- signal.hsignal.h is the standard C header that declares the signal-handling functions, types, and constants.
- signal numberA signal number is an integer identifier representing a particular signal in the C signal interface.
- biasBias is a systematic deviation between an observed measurement and the property it is intended to represent.
- instrumentationInstrumentation is the addition of code or mechanisms that observe or record properties of program execution.
- meanA mean value is the arithmetic average of a collection of numeric values.
- optimizationAn optimizer is a compiler component that transforms program code to improve execution or compilation while preserving required behavior.
- performance analysisPerformance assessment is the evaluation of a program's execution behavior using analysis or empirical evidence.
- raw momentA raw moment is the sum of a specified power of each value in a sample.
- relative standard deviationRelative standard deviation is the standard deviation divided by the mean, expressing dispersion relative to the measured magnitude.
- skewSkew measures the asymmetry or lopsidedness of a distribution around its mean.
- standard deviationStandard deviation measures the typical dispersion of observed values around their mean.
- statistical sampleA statistical sample is a finite collection of observed values drawn from a phenomenon or experiment.
- public visibilityVisibility is the property determining whether an identifier can be referenced from a particular part of a program.
- compound literalA compound literal is C syntax consisting of a type name in parentheses followed by an initializer that creates an unnamed object with the specified type and value.
- quick_exitquick_exit is a C standard-library function that terminates a program after running functions registered for quick termination.
- integer constant expressionAn integer constant expression is a C expression whose value can be determined during translation using only permitted constant operands and operations.
- global variableA global variable is a C object with program-wide or file-wide lifetime and visibility determined by its linkage and scope.
- recursionRecursion is a technique in which a computation is defined or performed by calls to the same computation on smaller or simpler inputs.
- acquire-release semanticsRelease semantics are memory-ordering properties that make preceding effects available to a thread that synchronizes with the release operation.
- command-line argumentA command-line argument is a string value supplied to a program when it is invoked from a command-line environment.
- extended character setAn extended character set is a repertoire that includes characters beyond the limited C basic character set, such as characters from additional scripts and writing systems.
- C23C23 is the ISO standard revision of the C programming language published in 2024.
- scopeA scope is a region of a C program within which an identifier is visible and its declaration applies.
- escape sequenceAn escape sequence is source-code notation beginning with a backslash that encodes a character or special value.
- acquire semanticsAcquire semantics are memory-ordering properties that make effects preceding a matching release operation visible after the acquire operation.
- critical regionA critical section is a region of execution that accesses shared state under synchronization to prevent conflicting concurrent operations.
- typeof operatortypeof is a C type operator that derives a type from an expression or type name without evaluating an expression operand.
- null pointer constantA pre-C23 null pointer constant is a compile-time constant expression of integer type and value zero or an expression of type void* that can be converted to a null pointer.
- basic typeA base type is the type from which a derived C type, such as a pointer type, is formed.
- valueA value is the data represented by an object or expression at a particular point in program execution.
- alignmentAlignment is the implementation-defined requirement that an object or structure member begin at an address suitable for its type.
- C++C++ is a general-purpose compiled programming language with C compatibility and object-oriented, generic, and low-level programming features.
- nodiscard attributeThe nodiscard attribute is a C23 attribute that recommends issuing a diagnostic when a function return value is ignored.
- opaque typeAn opaque data type is a type whose representation and implementation details are hidden from code that uses it.
- implicit conversionAn implicit conversion is an automatic C conversion that changes a value from one type to another according to the language's conversion rules.
- operatorAn operator is a C symbol or symbol sequence that specifies an operation on one or more operands.
- restrictrestrict is a C type qualifier that lets an implementation assume an object is accessed through a designated pointer-based access path during a relevant execution.
- struct tmstruct tm is the C standard-library structure type for representing broken-down calendar time components such as seconds, days, months, and years.
- time.htime.h is the C standard header that declares calendar-time types and functions, including struct tm and related interfaces.
- exitexit is a C standard-library function that terminates normal program execution and performs implementation-defined cleanup for the process.
- va_startva_start is a C standard-library macro that initializes a variable argument list for access by va_arg and related operations.
- happens-before relationA happened-before relation is a partial ordering that establishes that one event in a concurrent execution precedes another for purposes of reasoning about their effects.
- function pointer typeA function pointer is a C pointer value that designates a function and can be used to invoke or pass that function indirectly.
- translation unitA translation unit is the source-code unit produced after preprocessing a C source file and its included contents for compilation.
- mbrtowcmbrtowc is a C standard-library conversion function that converts a multibyte character sequence to a wide character while maintaining restartable conversion state.
- mbsrtowcsmbsrtowcs is a C standard-library function that converts a multibyte string to a wide character string while maintaining conversion state.
- multibyte characterA multibyte character is a sequence of bytes interpreted as one character from an extended character set.
- wide characterA wide character is a value of type wchar_t that represents exactly one character from an extended character set.
- wide character stringA wide character string is a null-terminated array of wchar_t values representing characters from an extended character set.
- complex floating-point typeA complex type is a C arithmetic type representing a complex number with real and imaginary components based on a corresponding real floating-point type.
- register keywordregister is a C storage-class specifier that requests automatic storage for an object and permits implementation-specific restrictions on taking its address.
- type inferenceType inference is the compile-time deduction of type information from an expression or declaration without explicitly writing the complete type.
- evaluationAn evaluation is the execution of a C expression or other construct to determine its value and associated effects.
- variadic argumentsA variadic parameter is the ellipsis-based parameter portion of a C function declaration that accepts additional arguments.
- structThe struct keyword introduces or refers to a C structure type through its structure tag.
- call_oncecall_once is a C threads-library function that invokes a callback at most once for a specified once-control object, coordinating concurrent callers.
- hexadecimal numberA hexadecimal format represents a value using base-sixteen digits.
- assertionassert is a C standard-library assertion macro that evaluates a runtime condition and calls abort when the condition is false.
- cnd_broadcastcnd_broadcast is a C threads-library function that wakes all threads waiting on a condition variable.
- cnd_signalcnd_signal is a C threads-library function that wakes one thread waiting on a condition variable.
- nullptr_tnullptr_t is the C23 distinguished type of the nullptr value and is distinct from every pointer type.
- endiannessEndianness is the ordering convention used to encode the bytes of multi-byte values in a representation.
- do statementA do-while loop is a C iteration statement that executes its body once and then repeats it while its controlling condition is true.
- strtoullstrtoull is a C standard-library function that converts the initial part of a string to an unsigned long long integer using a specified or inferred base.
- streamingA stream is an abstract C input or output sequence associated with a file, device, or other data source or destination.
- static storageA static object is a C object with static storage duration whose lifetime extends across the entire program execution.
- side effectA side effect is an observable change to program state caused by evaluating an expression or executing an operation.
- reserved identifierA reserved identifier is a name that programmers must not use for their own declarations because the C standard reserves it for specified or future library purposes.
- float64double is a C floating-point type providing at least the precision and range required for double-precision real-number calculations.
- autoauto is a C23 type-inference feature that allows an object's type to be inferred from its initializer.
- break statementA break statement terminates the nearest enclosing switch or iteration statement and transfers control to the following statement.
- __VA_ARGS____VA_ARGS__ is a predefined C preprocessor identifier that expands to the arguments supplied for a variadic macro's ellipsis parameter.
- lambdaAn anonymous function is a function construct without a program-level name, provided by a C extension for embedding callable behavior in expressions or macros.
- modification orderModification order is the total order of modifications to a particular atomic object that is consistent with each participating thread's sequenced-before order.
- stdbit.hstdbit.h is the C23 standard header that provides type-generic macros for inspecting and manipulating bits in unsigned integer values.
- strtoulstrtoul is a C standard-library function that converts the initial part of a string to an unsigned long value using an end-pointer and integer-base parameter.
- jmp_bufjmp_buf is an opaque C type for storing the execution environment used by setjmp and longjmp.
- pointer arithmeticPointer arithmetic is the C operation of forming pointer values by adding or subtracting integer offsets relative to elements of an array object.
- circular bufferA circular buffer is a fixed-capacity queue-like data structure whose logical sequence wraps around the end of an underlying array.
- memmovememmove is a C standard-library function that copies bytes between memory regions while correctly handling overlap between the regions.
- vectorA dynamic array is an array-like data structure whose storage can be allocated or resized during program execution.
- initializerAn initializer is C syntax that supplies an initial value for an object declared in source code.
- strspnstrspn is a C standard-library function that returns the length of the initial segment containing only characters from a specified string.
- storage classA storage class specifier is a C declaration specifier that controls an object's storage duration, linkage, or related storage properties.
- typedefA typedef is a C declaration that introduces an alias for an existing type.
- initializationInitialization is the process of providing an initial value for a C object as part of its declaration or creation.
- conditional logicAn if-else statement conditionally selects between alternative statements based on a controlling expression.
- header fileA header file is a source file containing declarations, macro definitions, and related information intended to be included by other source files.
- system timeCalendar time is a representation of time organized for human interpretation as dates and clock times.
- functionA function is a named C program unit that can be called to perform an operation and optionally produce a value.
- string.hstring.h is the C standard header that declares functions for manipulating strings and related memory sequences.
- ctype.hctype.h is the C standard header that declares character classification and character-case conversion facilities.
- stackA stack is a last-in, first-out storage structure in which function-call contexts are added and removed as calls and returns occur.
- __TIME____TIME__ is a predefined C macro that expands to a string literal containing the time of translation.
- macro expansionMacro expansion is the recursive process of replacing a macro invocation and any expandable macros in its arguments with source tokens.
- effective typeAn effective type is the type that C associates with storage allocated without a declared type through the accesses or stores that establish how the storage may be used.
- livelockA livelock is a concurrency failure in which threads continue executing but repeatedly make no effective progress in response to one another.
- labelA label is an identifier followed by a colon that marks a statement as a target for a goto statement.
- inliningInlining is a compiler transformation that replaces a function call with the called function's implementation.
- memory allocationDynamic allocation is a runtime mechanism that obtains storage for objects independently of ordinary declarations and releases it according to allocation operations.
- errnoerrno is a C library-provided modifiable object or macro designating an integer error indicator associated with the current thread or execution context.
- linearizabilityLinearizability is a concurrency correctness property under which each operation appears to take effect instantaneously at a point consistent with the ordering observed by threads.
- sprintfsprintf is a C standard-library function that formats converted values into a character array without imposing a destination-size limit.
- constexprconstexpr is a C23 language construct for declaring entities whose values or initialization satisfy compile-time constant-expression requirements.
- va_listva_list is the C library type used to represent the state of traversal through a variable argument list.
- bindingA variable is a named object whose stored value can be accessed and may change during program execution.
- failureAn error condition is a detected circumstance indicating that an operation cannot proceed normally or has not produced a valid result.
- macroA macro definition is a preprocessing directive that associates a macro name and optional parameters with replacement text.
- freefree is a C library function that releases dynamically allocated storage previously obtained from a compatible allocation function.
- namespace collisionA naming conflict is an unintended collision between names declared by different parts of a C program, library, implementation, or macro environment.
- naming policyA naming policy is a consistent set of rules for choosing names for program entities.
- allocated storage durationAllocated storage duration is the duration of an object created by a dynamic allocation function and ended by deallocation, reallocation, or program termination.
- thread storage durationThread storage duration is an object storage duration associated with a particular thread of execution.
- binary literalA binary integer literal is a C23 integer literal written with a 0b or 0B prefix and binary digits.
- decimal floating-point constantA decimal floating-point literal is a C floating-point literal written with decimal digits and optionally a fractional part and decimal exponent.
- decimal literalA decimal integer literal is a C integer literal written using decimal digits without a nondecimal base prefix.
- effective valueAn effective value is the value actually represented by a literal after the language's conversion and rounding rules are applied.
- hexadecimal floating-point constantA hexadecimal floating-point literal is a C floating-point literal written with a hexadecimal significand and a binary exponent introduced by P or p.
- literal suffixA literal suffix is a letter or letter sequence appended to a C literal to constrain or select its type.
- consistency modelThe C memory model is the language abstraction that defines how objects, storage, pointers, and program state relate without requiring a particular physical-memory arrangement.
- encodingAn encoding is a mapping or representation that associates data values with character or textual forms.
- cachingA cache is storage that retains previously computed values so they can be reused instead of recomputed.
- encapsulationEncapsulation is the practice of containing implementation details and associated state within a program unit while exposing a callable interface.
- Euclid's algorithmEuclid's algorithm is an algorithm for computing the greatest common divisor by repeatedly replacing a pair of integers with a smaller equivalent pair.
- exponential time complexityExponential computation time is runtime whose growth as input size increases is bounded by an exponential function.
- Fibonacci sequenceThe Fibonacci sequence is an integer sequence in which each term after the initial terms is the sum of the preceding two terms.
- greatest common divisorThe greatest common divisor of two positive integers is the greatest positive integer that divides both of them.
- multiple recursionMultiple recursion is recursion in which one invocation makes more than one recursive call.
- #embed#embed is a C23 preprocessing directive that inserts the binary contents of a file into a translation unit as a sequence of integer values.
- freadfread is a C standard-library function that reads a specified number of objects from a stream into memory.
- fwritefwrite is a C standard-library function that writes a specified number of objects from memory to a stream.
- constantA named constant is a program constant given an identifier so code can refer to its meaning instead of repeating its value.
- internationalizationInternationalization is the capability of software or a platform to accommodate multiple languages, scripts, and cultural or technical conventions.
- NFCNormalization Form C is a Unicode normalization form that canonically decomposes and then recomposes character sequences into a canonical composed form.
- UAX #31UAX #31 is a Unicode Standard Annex that specifies rules for identifying and using Unicode characters in identifiers and syntax.
- cnd_waitcnd_wait is a C threads-library function that atomically releases a mutex while waiting on a condition variable and reacquires it before returning.
- resource cleanupCleanup is the release or restoration of resources and state needed when an operation completes or fails.
- ptrdiff_tptrdiff_t is a signed integer type capable of representing the difference between pointers to elements of the same array.
- comparison functionA comparison function is a caller-supplied function that determines the ordering or equality of two data elements for an algorithm such as sorting or searching.
- bit operationA bitwise operator is a C operator that computes independently on corresponding bits of integer operands.
- memory boundA performance bottleneck is a program component or operation that substantially limits overall execution efficiency.
- strdupstrdup is a C library function that allocates storage and copies a null-terminated string into it.
- strndupstrndup is a C23 library function that allocates storage and copies at most a specified number of characters from a string.
- implementation definedImplementation-defined behavior is behavior for which the C implementation chooses among permitted alternatives and documents its choice.
- __FILE____FILE__ is a predefined C macro that expands to a string literal naming the current source file.
- __VA_OPT____VA_OPT__ is a C23 preprocessor feature that conditionally includes replacement tokens when a variadic macro receives one or more variable arguments.
- compilerA compiler implementation is the concrete software realization of a compiler that translates source programs according to a language's rules.
- portabilityPortability is the ability of software to operate across different platforms or computer architectures with little or no change.
- char(n)char is a C character type that occupies exactly one byte and is intended to represent individual characters.
- control flowControl flow is the order in which execution proceeds among a program's operations and functions.
- integer promotionInteger promotion is the implicit conversion of a narrow integer type to an integer type before certain C expressions are evaluated.
- variable-length arrayA variable-length array is a C array whose bound is determined at run time rather than being an integer constant expression.
- race conditionA race condition is an execution condition in which the result depends on the relative timing or interleaving of accesses by concurrent or asynchronously executing code.
- unsequenced operationUnsequenced evaluation is an evaluation relationship in which the relative order of two evaluations is not specified and they may be interleaved.
- UTF-8UTF-8 is a variable-length Unicode encoding that represents each code point as a sequence of one to four bytes.
- bsearchbsearch is the C standard-library function that performs a binary search on a sorted array using a comparison function.
- function decayFunction decay is the C conversion in which an expression designating a function is converted to a pointer to that function in applicable contexts.
- qsortqsort is a C standard library function that sorts the elements of an array using a caller-supplied comparison function.
- observable stateObservable state is program state whose value or effects can be detected by code or users outside the component that maintains it.
- read-modify-write operationA read-modify-write operation atomically reads an object, computes or selects a new value, and writes that value as one indivisible operation.
- struct timespecstruct timespec is a C structure type representing a time value with seconds and a nanosecond component.
- synchronizes-with relationA synchronizes-with relation is an ordering relationship in which an acquire evaluation reads a value written by a release evaluation in another thread.
- character classA character class is a set of characters sharing a property such as being alphabetic, numeric, whitespace, or punctuation.
- variadic macroA variadic macro is a function-like C preprocessor macro that accepts a variable number of arguments through an ellipsis parameter.
- typeof_unqualtypeof_unqual is a C23 type operator that derives the unqualified version of a type from an expression or type name.
- case statementA switch statement is a C selection statement that transfers control to a matching case or default label based on an expression's value.
- valid pointerA valid pointer is a pointer value whose state permits the pointer operations defined by the C language.
- byte streamA binary stream is a C stream that transfers data as sequences of bytes without text-oriented character transformations.
- commentA comment is source text that the C compiler ignores and that can document a program.
- function declarationA function definition is a C construct that specifies a function's declaration and body.
- base pointerA base pointer is a processor register used as a stable reference point for accessing a function's stack-resident data.
- hardware registerA hardware register is a small, processor-resident storage location that holds values used during instruction execution.
- mtx_lockmtx_lock is a C threads-library function that blocks until the calling thread acquires a mutex.
- mtx_unlockmtx_unlock is a C threads-library function that releases a mutex previously acquired by the calling thread.
- stack pointerA stack pointer is a processor register that identifies the current top of a function-call stack area.
- von Neumann modelThe von Neumann model is a computer architecture model with a processor, registers, linearly addressable memory containing programs and data, and a finite instruction set.
- preprocessorThe C preprocessor is a translation phase that processes preprocessing directives and expands macros before compilation.
- missing valuenullptr is the C23 null pointer constant used to represent a null pointer value.
- regex groupingA capture is a lambda specification identifying variables from the surrounding scope that are made available inside the lambda.
- closureA block closure is an anonymous function construct that can access variables from its surrounding context, subject to capture and modification rules.
- compound expressionA compound expression is a compiler extension that groups statements and expressions into a single expression whose value is the value of its final expression.
- tgmath.htgmath is the C type-generic mathematics facility that provides interfaces selecting numerical functions according to argument types.
- sign bitA sign bit is the bit in a signed integer representation that indicates whether the represented value is nonnegative or negative.
- signed arithmetic overflowSigned arithmetic overflow is the condition in which a signed integer operation produces a result outside the range representable by its result type.
- signed integer arithmeticSigned arithmetic is arithmetic performed on values of signed integer types, with results subject to the rules for signed representations and overflow.
- two's complementTwo's complement is a signed-integer representation in which the high-order bit contributes negative weight and the remaining bits contribute positive weights.
- file positionA file position is the location within a stream at which the next read or write occurs.
- fseekfseek is a C standard-library function that changes a stream's file position relative to a specified reference position.
- ftellftell is a C standard-library function that reports a stream's current file position as a byte offset from the beginning of the file.
- __has_embed__has_embed is a C23 preprocessing feature that tests whether a specified file can be embedded.
- enum constantAn enumeration constant is a named integer constant declared as a member of a C enumeration.
- bytesA byte is the C memory unit corresponding to the storage occupied by one char object and used as the basic unit of object representation.
- floating-point stateFloating-point state is execution state that controls or records the behavior of floating-point operations, including rounding and contraction.
- local static stateLocal static state is state held by objects with static storage duration that are declared within a function or local program region.
- booleanbool is a C type whose values represent logical truth and falsity.
- calloccalloc is a C standard-library function that allocates storage for an array of elements and initializes all allocated bytes to zero.
- gmtime_rgmtime_r is a C time-conversion function that stores a time_t value as broken-down Coordinated Universal Time.
- localtime_rlocaltime_r is a C time-conversion function that stores a time_t value as broken-down local time.
- mktimemktime is a C standard-library function that normalizes a local broken-down time and converts it to time_t.
- strftimestrftime is a C standard-library function that formats a broken-down time into a caller-provided character array according to a format string.
- atexitatexit is a C standard-library function that registers a function to be called during normal program termination.
- NDEBUGNDEBUG is a C preprocessing macro whose definition conventionally controls whether assertion-related debugging checks are enabled.
- termination handlerA termination handler is an application-supplied function executed as part of a program's termination processing.
- temporary objectA temporary object is an unnamed C object created for an intermediate expression or initialization and given automatic temporary lifetime.
- deadlockA deadlock is a condition in which multiple execution entities are permanently blocked because each depends on a resource or action held up by another in a cycle.
- memchrmemchr is a C standard-library function that searches a specified memory region for a byte value.
- memcpymemcpy is a C standard-library function that copies a specified number of bytes from one nonoverlapping memory region to another.
- strcmpstrcmp is a C standard-library function that lexicographically compares two null-terminated strings.
- strcpystrcpy is a C standard-library function that copies a null-terminated string into destination storage.
- stringA C string is an array of char whose elements end with a terminating zero character.
- strlenstrlen is a C standard-library function that returns the number of characters before the terminating zero in a string.
- opaque objectAn opaque structure is a C structure type whose complete member definition is hidden from code that uses its interface.
- token concatenationThe token concatenation operator ## joins two preprocessing tokens into a single preprocessing token during macro replacement.
- void pointerA void pointer is a C pointer to void that can hold the address of an object of any object type, subject to valid conversions and qualification rules.
- comparisonA comparison operator is a C operator that evaluates a relational condition between two operands and produces a Boolean result.
- stringification operatorMacro argument stringification is the C preprocessing technique of converting a macro argument's textual spelling into a string literal.
- strcspnstrcspn is a C standard-library function that returns the length of the initial segment containing none of the characters from a specified string.
- livenessLiveness is the property that a concurrent program continues to make progress rather than becoming permanently blocked or stalled.
- stdc_bit_widthstdc_bit_width is a C23 facility that identifies the highest-positioned one-valued bit through the width of an integer's significant bit representation.
- blockA block is a grammatical structure that groups declarations and statements within a delimited program region.
- file scopeFile scope is the scope of an identifier declared outside a function or block, extending through the relevant source file.
- array parameterAn array parameter is a function parameter declared with array notation whose array-bound information is adjusted or lost when used in a function definition or call.
- external linkageExternal linkage is the property allowing declarations in different translation units to designate the same C entity.
- internal linkageInternal linkage is the property restricting an identifier's designated entity to a single translation unit.
- linkageLinkage is the C property determining whether declarations in different scopes or translation units can designate the same entity.
- linkerA linker is a tool that combines compiled program components and resolves references to produce an executable or other linked program image.
- character classifierA character classifier function is a C library interface that tests whether a character belongs to a specified character class.
- execution character setAn execution character set is the implementation-defined mapping used to represent characters during C program execution.
- bit-precise typeA bit-precise type is a C integer type with a precisely specified width in bits.
- compound statementA compound statement is a C statement consisting of a brace-delimited sequence of statements treated as one statement.
- do-while(false) trickA do-while macro wrapper is a macro pattern that encloses multiple statements in a single statement-like construct using a do loop whose condition is false.
- rational typeThe rational type is a book-specific C structure type representing a rational number with a numerator, denominator, and sign.
- normalizationNormalization is the process of choosing a canonical representation of a rational number by reducing common factors from its numerator and denominator.
- rational numberA rational number is a number that can be expressed as the quotient of two integers with a nonzero denominator.
- continue statementA continue statement skips the remaining body of the current loop iteration and proceeds with that loop's next iteration step.
- Heron approximationThe Heron approximation is an iterative numerical method for refining an estimate of a reciprocal or square-root-related quantity.
- maybe_unused attributeThe maybe_unused attribute suppresses diagnostics for declarations or definitions whose identifiers might not be used.
- multiplicative inverseA multiplicative inverse of a nonzero number is a number whose product with it equals one.
- secondary blockA secondary block is the block formed by the loop body associated with a for construct in the terminology used here.
- address-of operatorThe address-of operator is the C unary operator that obtains a pointer to an object or function designated by its operand.
- type traitA type trait is a compile-time operation that queries a property of a type and produces a result representing that property.
- narrow typeA narrow type is a C integer type that undergoes integer promotion before being used in an arithmetic expression.
- time_ttime_t is an implementation-defined C type used to represent calendar time values.
- data conversionA cast is an explicit C conversion construct that requests conversion of an expression to a specified type.
- replacement textReplacement text is the source token sequence specified by a macro definition for insertion when the macro expands.
- macro invocationA macro invocation is source text consisting of a function-like macro name followed by parentheses containing its arguments.
- return typeA return type is the type of value that a C function supplies to its caller, or void when it supplies no value.
- double-underscore attribute formA double-underscore attribute form is an attribute spelling whose identifier is prefixed and postfixed with double underscores to avoid collisions with application-defined macros.
- format attributeA format attribute supplies a compiler with the positions of a formatted-output specification and its variable arguments in a function call.
- __has_c_attribute__has_c_attribute is a C preprocessor feature-test operator that reports whether an attribute is supported.
- prefixed attributeA prefixed attribute is an implementation-defined attribute whose name combines an implementation prefix, the :: token, and a feature suffix.
- standard attributeA standard attribute is an attribute defined by the C standard with a specified meaning and syntax.
- indeterminately sequenced evaluationIndeterminately sequenced evaluation is an evaluation relationship in which one evaluation completes before the other, but the language does not specify which occurs first.
- sequence pointA sequence point is a point in C execution at which the language requires specified evaluations and side effects to be completed or ordered relative to other evaluations.
- release operationA release operation is a synchronization operation that makes preceding effects available to a corresponding acquire operation.
- thrd_jointhrd_join is a C threads-library function that blocks the calling thread until a specified thread terminates and optionally retrieves its result.
- default valueA default argument is a value supplied automatically when a caller omits an otherwise optional function argument.
- bit fieldA bit-field is a C structure or union member declared with a specified number of bits rather than a complete storage-unit width.
- bit paddingBit padding is unused storage at the bit level within a representation, including bits that do not fall on byte boundaries.
- paddingByte padding is unused whole-byte storage inserted within or after a structure to satisfy layout or alignment requirements.
- shared resourceA shared object is an object whose storage and value can be accessed by more than one thread.
- sizeof operatorThe sizeof operator is a C unary operator that yields the size in bytes of a type or object representation.
- stdarg.hstdarg.h is the C standard header that declares the types and macros for processing variable argument lists.
- va_argva_arg is a C library macro that retrieves the next argument from a va_list using a specified type.
- vfprintfvfprintf is a C standard-library function that formats output to a stream using a va_list of arguments.
- set unionSet union is the operation producing a set containing every element that belongs to either operand set.
- union typeA C union is a user-defined type whose members occupy overlapping storage and are represented by the same memory location.
- naming standardA naming convention is a systematic rule for choosing identifiers so that related entities are recognizable and less likely to collide.
- narrowing conversionA narrowing conversion is a conversion to a type that represents a smaller range or less precise set of values than the source type.
- signednessSignedness is the property of an integer type that determines whether its values include negative numbers or are restricted to nonnegative numbers.
- in-memory formatAn object representation is a model describing the physical or storage-level encoding of a value in memory.
- static_assertA static assertion is a C compile-time check that requires a constant Boolean condition to be true and otherwise produces a diagnostic.
- designated initializerA designated initializer is an initializer that explicitly selects an array element or structure member by designation before assigning its value.
- JavaScript runtimeA runtime environment is the software and system context that provides resources and services while a program executes.
- non-value representationA non-value representation is a bit pattern that does not represent any valid value of its object type.
- storage instanceA storage instance is a particular occurrence of storage associated with an object declaration or function invocation, especially when recursive calls create separate occurrences.
- enumAn enumeration is a C type that defines a set of named integer values.
- underlying typeAn underlying type is the integer type used to represent the values of a C enumeration.
- contractA library interface is the specified set of declarations and calling conventions through which software accesses library functionality.
- taskA task is a distinct part of a program's work that can be performed with little or no interaction with other tasks.
- thrd_createthrd_create is a C11 threads-library function that creates and starts a new thread with a specified start routine.
- threads.hthreads.h is the C standard header that declares the C11 thread-management and thread-synchronization interfaces.
- arithmetic computationInteger arithmetic is arithmetic performed on values of integer types, including addition, subtraction, multiplication, division, and remainder operations.
- ckd_addckd_add is a C23 type-generic checked-addition macro that stores the result through a pointer and reports whether the mathematical addition overflowed.
- divdiv is a C standard-library function that computes the quotient and remainder of two int values and returns them in a structure.
- stdckdint.hstdckdint.h is the C23 standard header that declares type-generic checked integer arithmetic macros.
- const qualifierA const-qualified type is a C type whose referenced value is not modifiable through an expression having that type.
- array lengthArray length is the number of elements contained in an array object.
- invalid pointerAn invalid pointer is a pointer value whose state does not permit reliable evaluation or use according to the C language rules.
- end-of-file indicatorEnd-of-file is the condition indicating that no more input is available from a stream.
- feature testA feature test is a compile-time or configuration-time check that determines whether an implementation supports a specified language or library feature.
- fenv.hfenv.h is the C standard header that provides access to the floating-point environment and its status and control facilities.
- floating-point environmentThe floating-point environment is the implementation state that controls and records floating-point exception conditions and related behavior.
- pointer comparisonPointer comparison is an operation that evaluates an ordering or equality relationship between pointer values.
- environment variableAn environment variable is a named string setting provided through a program's runtime environment.
- format modifierA format modifier is an optional format-specification component that identifies the size or semantic type of the corresponding argument.
- fprintffprintf is the standard C formatted-output function that writes formatted text and converted argument values to a specified stream.
- imperative programmingA programming paradigm in which programs specify computations as ordered commands that change program state or direct execution.
- truthinessA truth value is the logical interpretation of a C value as true or false in a condition or logical operation.
- C standard libraryA C library function is a function provided by the standardized C library for use by C programs.
- program state degradationProgram state degradation is a worsening of the execution state that progressively reduces the program's ability to continue correctly.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
