Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4 |
both |
#define _XOPEN_SOURCE
#include <search.h>
int hcreate(size_t nel);
The hcreate() function allocates sufficient space for a hash table containing nel elements, and must be called before hsearch() is used.
The nel argument is an estimate of the maximum number of entries that the table will contain. This number may be adjusted upward by hcreate() for the actual table allocation in order to obtain certain mathematically favorable circumstances.
Threading Behavior: see hsearch() — Search hash tables.
If successful, hcreate() returns nonzero.