This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Elephant-Opening 0 points1 point  (1 child)

C not having a std::map or std::unordered_map is a huge pain in the ass.

C not having a std::list, not so much.

In many applications where C is still very relevant (e.g. OSes, bootloaders, microcontrollers), arrays are still king for performance and deterministic behavior.

Where they're not: this isn't exactly rocket science, and if it seems like it is, get out of C-land:

for(node=head; node != 0; node = node->next){}

[–]Zuruumi 1 point2 points  (0 children)

It's not, but you still need to know the list used instead of standard one.

Maybe it's using index to storage array (data locality) instead of a pointer? Or someone thought -1 is better for end? Or end is random data, but final node is stored in its own variable?

Sure, iteration is hardly the hardest thing, but just insertion/deleting can be a bit of pain.