Relative Content

Tag Archive for carrays

constexpr sorted array of struct key value how to search it efficiently?

I have a long array of key+value data that I would like to initialize into my source code with constexpr initializer. I can sort the array myself in the source code, so it could be efficiently searched with a binary search algorithm. The structure has a key part and one (or more) value parts.

Reverse an array in c

I checked some videos of reversing an array in C therefore I know that my logic is correct. Here’s my code: