Hacker News new | ask | show | jobs
by asdfasgasdgasdg 2310 days ago
That C code wouldn't work if the strings in the map are mutable (which they are in C++). It wouldn't work if the strings were allocated dynamically either. Once you write all the code required to get it working that way, the C starts comparing less favorably to C++.
1 comments

> That C code wouldn't work if the strings in the map are mutable (which they are in C++). It wouldn't work if the strings were allocated dynamically either

I don't see why not? You'll have to decide the ownership semantics if they're dynamically allocated but that's it?