CC

C glossary – key terms explained

Buffer overflow

Writing beyond the end of a buffer. The most common cause of security vulnerabilities in C programs.

Call by value

C passes function arguments as a copy. To change the caller's values, you pass pointers.

Compiler

Program that translates C source code into machine code (e.g. gcc, clang).

Dangling pointer

Pointer that points to memory that has already been freed or no longer exists (e.g. a local variable).

errno

Global variable (<errno.h>) in which library functions store the error code after a failure; strerror and perror turn it into text.

Header file

File (.h) containing declarations of functions, types and macros, included with #include.

Heap

Memory region for dynamically allocated memory (malloc) that must be freed manually with free.

Include guard

#ifndef/#define/#endif around a header so that it takes effect only once when included multiple times.

Linker

Combines object files and libraries into the finished executable program and resolves function references.

Macro

Text substitution by the preprocessor defined with #define; knows no types and may evaluate arguments multiple times.

Memory leak

Memory was requested with malloc but never freed – the program consumes more and more RAM.

NULL

Special null pointer that points to nothing. Must never be dereferenced.

Null-terminated string

String as a char array ending with the null byte \0; the basis of all string functions in C.

Object file

Intermediate file (.o) produced by the compiler, containing the machine code of a single .c file; not yet runnable.

Padding

Filler bytes inserted by the compiler in structs so that fields sit at their natural alignment.

Pointer

Variable that stores the memory address of another value; dereferenced with *, created with &.

Preprocessor

First stage of translation: processes lines starting with # (#include, #define, #if) through pure text substitution.

Sanitizer

Compiler tool (e.g. -fsanitize=address) that detects and reports memory errors and undefined behavior at runtime.

Segmentation fault

Crash caused by an illegal memory access, e.g. dereferencing NULL or writing to read-only memory.

size_t

Unsigned integer type for sizes and indices; return type of sizeof and strlen (format %zu).

Stack

Memory region for local variables and return addresses; grows and shrinks automatically with function calls.

struct

Composite data type that bundles several named fields of different types.

typedef

Gives an existing type a new name, e.g. typedef struct {...} Punkt;.

Undefined behavior

Situations for which the C standard specifies no behavior (e.g. array overflow, signed overflow). Anything can happen.