for — loop with initialization, condition, and update
The for loop combines initialization, condition checking, and an update. It repeats a loop body, possibly zero times, and can limit a control variable's scope to the loop.
CKTIS / C
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
The for loop combines initialization, condition checking, and an update. It repeats a loop body, possibly zero times, and can limit a control variable's scope to the loop.
_Generic selects an expression by compatible type rather than value; its controlling expression is not evaluated.
The goto statement unconditionally transfers control to a named label in the same function, including out of nested loops.
The `if` statement selects a branch based on a condition. An optional `else` handles the false case.
_Imaginary specifies a type holding a purely imaginary value. Support is optional: selecting C23 mode alone does not guarantee availability.
`inline` suggests fast calls but does not force inline expansion. It also affects function-definition rules.
_Noreturn marks a function that never returns to its caller. C23 retains it as an obsolescent feature; prefer [[noreturn]].
In C23, nullptr denotes a null pointer constant with its own type, distinct from pointer and arithmetic types.
register suggests fast access but does not guarantee a CPU register. It also restricts taking an object's address.
restrict qualifies a pointer and imposes requirements on object access. Violating these requirements causes undefined behavior.
The return statement ends the current function call. It can deliver a result to the caller according to the function's return type.
The signed keyword specifies a signed integer type. On its own, signed means signed int, which is int.
The meaning of static depends on context: a persistent local object, internal linkage, or a required argument-array size.
static_assert checks a constant condition during program translation rather than testing it at runtime.
The struct keyword defines or names a structure type that groups named members, potentially of different types.
switch transfers control to a matching case label or the optional default. Labels do not stop execution; break exits the statement.
thread_local gives an object thread storage duration. _Thread_local remains an equivalent but obsolescent spelling.
In C23, true is a keyword representing a constant of type bool with value 1. It does not require the <stdbool.h> header.
The typedef keyword gives a type an additional name. It creates neither a distinct type nor an object.
In C23, typeof lets a declaration use the type of an expression or a type name while preserving qualifiers.
C23 typeof_unqual derives a non-atomic, unqualified type from an expression or a type name.
The union keyword defines a type whose members share storage. Unlike struct, it does not retain their independent values simultaneously.
The unsigned keyword specifies an unsigned integer type. Used alone, unsigned means unsigned int.
volatile preserves required object accesses but does not provide atomicity or thread synchronization.