Skip to content

Instantly share code, notes, and snippets.

@uap-universe
uap-universe / enumerate_selection.c
Created January 18, 2026 10:53
Enumerates all index selections for a dynamic number of arrays with different sizes
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h> // not required in C23 anymore
/**
* Enumerate all index combinations.
*
* The @p indices array shall be initially @c NULL and
* will be allocated by this function and must be passed
* free().