Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
如果您想要像 STL 那样的通用数据结构,
glib
可能就是您问题的答案。但更好的问题可能是你为什么用 C 语言编写程序?当您不使用过于通用的代码来执行可以通过特定于您手头的特定任务的方式更好地执行的任务时,C 的潜力就会显现出来。glib
只是给你“语法丑陋的 C++”(并且编译器优化的能力较差)。If you want general-purpose data-structures like STL has,
glib
is probably the answer to your question. But a better question might be why are you writing your program in C? C's potential to shine comes when you don't use overly-general code to perform tasks that could be better performed in ways specific to your particular task at hand.glib
just gives you "C++ with ugly syntax" (and less ability for the compiler to optimize).我知道的最接近的是 GTK 的 glib,请参阅 http://library.gnome.org/devel /glib/2.26/
The closest I know if is glib from GTK, see http://library.gnome.org/devel/glib/2.26/
是的。 GLib 是 C 语言中最接近 STL 的东西。如果您发现它使用起来相当复杂,请尝试 Vala。这要容易得多。 http://live.gnome.org/Vala
Yes. GLib is the closest thing to STL in C. If you find it quite complex to use, try Vala. It is much easier. http://live.gnome.org/Vala