How to emulate map literals in C?

This page summarizes the projects mentioned and recommended in the original post on /r/C_Programming

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • STC

    A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers. (by stclib)

  • Probably a function with a switch statement if the map is small. Otherwise, with my STC lib, you can do:

  • nnn

    n³ The unorthodox terminal file manager

  • u/N-R-K followed up with a neat Robin Hood hash that's been merged into nnn.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • gperf

    mirror of git.savannah.gnu.org/gperf.git with more features. gitlab has the issues

  • Adding to this, there are tools such as gperf which are specifically designed for this. Apparently gperf works well for smaller number of keys but not for really high n (> 100,000 ish) and mph apparently works better for larger n.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts