03-27-07 12:32 AM
On Mar 26, 3:24 pm, mr.h...@gmail.com wrote:
> Hi,
>
> I am using freeBSD.
> I know std:set can be used in C++ for set colleciton . No similar
> thing in standard C lib.
>
> If I use only C for developing some applicaiton on freeBSD, is there
> any unix extension to standard C library or alternative library for
> 'set'(i.e, uniqueness) operation?
Look at the functions in search.h (eg, tsearch(3)). C++98's std::set
tends to provide a set-like interface to a binary tree implementation,
so you could provide your own light interface wrapper around the POSIX
tree implementation.
My man page says the tree functions are SVID only; the hash map (eg,
hcreate(3)) functions are POSIX, though, and those could also be
adapted to provide set-like operations.
Josh
[ Post a follow-up to this message ]
|