is there an equivalent in C of python's set()?

非 Y 不嫁゛ 提交于 2019-12-10 17:18:44

问题


I m seeking some equivalent in C of python's set() variable type any ideas? here is the python doc about sets http://docs.python.org/2/library/sets.html

and could you explain/link me a help for this? please


回答1:


No, there isn't. The Python datatype relies on a lot of things regarding Python objects that the more low-level data you typically work with in C simply don't have.

Like being able to compare two "objects" reliably, regardless of their type or internal structure.

The more you know about your data the easier it will be to roll your own, of course.

I would recommend you look at glib's hash tables if you want to use a library.



来源:https://stackoverflow.com/questions/13179605/is-there-an-equivalent-in-c-of-pythons-set

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!