移植的std ::地图为C? [英] Porting std::map to C?

查看:108
本文介绍了移植的std ::地图为C?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我移植了一些C ++ code到c。什么是性病的一种可行相当于::地图在C?
我知道在C中没有等价的。

I am porting some c++ code to c. What is a viable equivalent of std::map in c? I know there is no equivalent in c.

这是我在想什么使用:

在C ++:

std::map< uint, sTexture > m_Textures;

在C:

typedef struct
{
  uint* intKey;
  sTexture* textureValue;
} sTMTextureMap;

是可行的还是我简化地图太多了?万一你没有得到它的目的纹理贴图。

Is that viable or am I simplifying map too much? Just in case you did not get the purpose its a Texture Map.

推荐答案

uthash 对于C一个易于使用的哈希表结构。
结果通过: http://en.wikipedia.org/wiki/Hash_table

uthash "an easy-to-use hash table for C structures."
via: http://en.wikipedia.org/wiki/Hash_table

这篇关于移植的std ::地图为C?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆