Generic selection

Generic selection

Provides a way to choose one of several expressions at compile time, based on a type of a controlling expression.

Syntax

_Generic ( controlling-expression , association-list ) (since C11)

where association-list is a comma-separated list of associations, each of which has the syntax.

type-name : expression
defa