std::vector alternative for C [closed]

本小妞迷上赌 提交于 2019-12-05 14:45:48

问题


I wonder if there is an alternative for the std::vector in C? I found this implementation but it seems to contain some issues with memory reallocation.


回答1:


While reading C Array vs. C++ Vector, I found an interesting implementation of a simple vector container in C, which also includes push/pop operations. It's worth reading it!




回答2:


You can give glib and its arrays (GArray) a try.

glib is actively maintained, cross platform, open source (LGPLv2+), and it doesn't stop on arrays/vectors. You also have hash tables, linked lists, queues and many other data structures.




回答3:


If you focus is on mathematics you can work with GSL, there have a more bare bones math centric concept.



来源:https://stackoverflow.com/questions/4924485/stdvector-alternative-for-c

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