Hacker News new | ask | show | jobs
by tgflynn 1425 days ago
It's not an implementation detail, it is part of the interface. The data it points to belongs to the caller and the caller is responsible for managing it, just like anywhere else in C.
1 comments

> The data it points to belongs to the caller and the caller is responsible for managing it

Going back to the start of the thread where you said you didn't understand this:

> this means that using, say, a dictionary means that quite a bit of the implementation gets hard coded into every site that uses the dictionary

You can see you've just said yourself what you were saying you didn't understand - with data structures in C you're responsible for manually managing things that the data structure would via things like generics in most other languages, with you having to instead hard-code them at the use-site to turn the data into something that can be pointed to and managing the lifetime.