问题描述
我现在正在学习C,因为我知道perl和一些python.我进行了快速搜索,发现没有像perl/python中那样的显式哈希/字典,而且我看到人们在说您需要一个函数来查找哈希表.所以事实是C没有提供固有的哈希结构,您必须编写一些函数才能在C中使用哈希?
I'm learning C now coming from knowing perl and a bit python. I did a quick search and found there is no explicit hash/dictionary as in perl/python and I saw people were saying you need a function to look up a hash table. So the fact is C doesn't provide an inherent hash structure and you have to write some function to be able to use hash in C?
推荐答案
基本上,C具有的唯一数据结构是数组,结构(有点像映射,但必须在编译时知道键),并且工会.其他所有内容都必须手动编码或由库提供.
Basically, the only data structure that C has are arrays, structs (which is kind of like a map, but the keys must be known at compile time) and unions. Everything else must be coded manually or provided by a library.
这篇关于C是否具有哈希/字典数据结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!