3 ms·
I was hoping this would actually tell me how to accomplish something in C. I know all about pointers and memory, but I don't know anything about the current sta
by pkulak 11y ago
I was hoping this would actually tell me how to accomplish something in C. I know all about pointers and memory, but I don't know anything about the current state if C development. What libraries do people use? What are common memory management strategies? Etc.
- yoklov 11y agoLibraries depend on what you need to do. A lot of work is done with just the std lib. For domain specific stuff you use domain specific stuff. For generic stuff, well, you tend not to want generic data structure libs that come with other languages stdlibs because its hard to do those both efficiently and cleanly (you can only pick one). Its easy enough to hack up a dynamic array or a hash table with a fixed capacity that can only insert and get, maybe delete, so you tend to do this when you need it. (Also, a sorted array usually does very well in place of a hash table with not much code) Memory managment it depend what your doing. I use a lot of arenas, and pools, and as a result very rarely have to worry too much about memory management. Some things become harder here like dynamically sized arrays, but you can do this with chunks of fixed length arrays. (or whatever) I have to do very little string processing most of the time (and when i do they usually have small, known maximum lengths), and i imagine this memory management technique would work less well for that.
- pjc50 11y agoThis depends so much on what you're doing. You get entirely different answers for embedded systems, UNIX, Windows, games, and so on.
- benwaffle 11y agohttps://notabug.org/koz.ross/awesome-c https://notabug.org/koz.ross/awesome-c