C Reference ยท Concepts and Tools
C glossary: key terms explained
A glossary of C terms: lvalue, translation unit, linkage, storage duration, undefined versus unspecified behavior, decay, ABI, UB and more, with short examples.
C has its own precise vocabulary, and the standard and compiler messages use it constantly. A message such as "lvalue required as left operand of assignment" or "multiple definition of symbol with external linkage" is much easier to act on when you know the terms. This glossary defines the ones that matter in daily work, grouped by topic, and links to the page that explains each in depth.
Try it
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.
Language and program structure
| Term | Meaning |
|---|---|
| Translation unit | A source file after preprocessing (with all its includes). The compiler sees one at a time. |
| Declaration | Introduces a name and its type. Definition: also creates the object or the function body. |
| Prototype | A function declaration that lists parameter types: int f(int, char *); |
| Scope | The region where a name is visible: file, block, function prototype or function (for labels). |
| Linkage | Whether the same name in different places refers to the same entity: external (across files), internal (static, one file), none (locals). See Linkage. |
| Storage duration | How long an object lives: static (whole program), automatic (block), allocated (until free), thread. See Storage duration. |
| Identifier | A name for a variable, function, type, label or macro. |
| Keyword | A reserved word such as while or struct; see Reserved identifiers. |
| Tag | The name after struct, union or enum. |
| Compound literal | An unnamed object created inline: (struct point){1, 2}. See Compound literals. |
| Designated initializer | Initializing by name or index: {.x = 1, [3] = 9}. |
| Flexible array member | A last, unsized array member of a struct: int data[];. See Flexible arrays. |
| Attribute | Standard [[...]] annotation (C23) giving the compiler extra information. |
Types and expressions
| Term | Meaning |
|---|---|
| Object | A region of storage that can hold a value. |
| lvalue | An expression that designates an object, so it can be assigned to or have its address taken. Pre-C11 literature also says rvalue for a non-lvalue value. See lvalues. |
| Integer promotion | Narrow types (char, short, bool) become int in arithmetic. |
| Usual arithmetic conversions | The rules that bring two operands to a common type. See Conversions. |
| Decay | An array converts to a pointer to its first element; a function to a pointer to itself. |
| Pointer | A value that refers to an object or function. Null pointer: compares unequal to every valid pointer (NULL, nullptr in C23). |
| Dangling pointer | Points at an object whose lifetime ended (freed memory, returned local). |
| Wild pointer | Uninitialized and indeterminate. |
| Void pointer | void *, a generic object pointer without arithmetic. |
| Qualifier | const, volatile, restrict, _Atomic. See Type qualifiers. |
| Padding | Unused bytes the compiler inserts in structs for alignment. |
| Alignment | The address multiple at which an object must be stored. |
| Bit-field | A struct member with a given width in bits. |
| Sequence point | A point at which side effects of earlier evaluation are complete. See Sequence points. |
| Side effect | A change to an object, a volatile access or I/O performed by an expression. |
Behavior categories
| Term | Meaning |
|---|---|
| Undefined behavior (UB) | The standard places no requirements at all: the program may crash, give a wrong answer, or seem to work. Examples: signed overflow, out-of-bounds access, using a freed pointer. See Undefined behavior. |
| Unspecified behavior | The standard allows several outcomes and the compiler need not say which, for example the order of evaluating function arguments. |
| Implementation-defined behavior | The compiler must document its choice, for example sizeof(int) or the result of -7 >> 1. See Implementation-defined. |
| Locale-specific behavior | Depends on the current locale. |
| Strictly conforming program | Uses only defined features and gives the same output everywhere. |
| Hosted / freestanding | A hosted environment has the full standard library and main; freestanding (kernels, microcontrollers) has only a small subset. |
| Constraint violation | A rule breach that requires a diagnostic (an error or warning) from the compiler. |
Build and runtime terms
| Term | Meaning |
|---|---|
| Preprocessor | Handles #include, #define, conditionals before compilation. |
| Object file | Compiled machine code for one translation unit (.o). See Linking. |
| Linker | Joins object files and libraries into an executable. |
| Static / shared library | .a (copied into the program) versus .so/.dll (loaded at run time). |
| ABI | Application binary interface: calling convention, type sizes and layout that compiled code agrees on. |
| Stack / heap | Automatic storage grows on the stack; malloc memory comes from the heap. See Stack and heap. |
| Memory leak | Allocated memory that is never freed and no longer reachable. |
| Buffer overflow | Writing past the end of an array or allocation. See Buffer overflow. |
| Use after free / double free | Accessing or freeing memory after it was freed. See Memory errors. |
| Segmentation fault | The operating system's response to an invalid memory access (a symptom, not a C concept). |
| Data race | Two threads access the same non-atomic object without synchronization, one writing: UB. |
| Idiom | A conventional code pattern; see Common C idioms. |
Usage notes
- Say "undefined" only when you mean it. Implementation-defined results are portable-in-principle and documented; undefined behavior is never safe.
- A diagnostic is not an error. The standard only requires a message for constraint violations; compilers may still produce an executable.
- Terms differ in C++. For example, a C++
classhas no C counterpart, andconstat file scope has internal linkage there but not in C. - Keywords with several meanings:
staticmeans internal linkage at file scope and static storage inside a function; see static.