user and group names from uid and gid
The title kinda says it all. I know that stat() in C or C++ will give me, amongst other things, the uid of the owner and the gid of the file. But how do I translate the integer uid into a name? The specific implementation I'm looking at is C++, but C ways of doing this work too.