Using the shadowentry class

The shadowentry class allows you to look up entries from /etc/shadow or from elsewhere if you're using the Name Service Switch.

int main(int argc, const char **argv) {
}