#include <sys/types.h> /* getpwnam() */
#include <pwd.h> /* getpwnam() */
#include <stdio.h> /* printf() */
int main (void) {
char **users = (char*[]){ "pegasus", "shanti", "jaguar", NULL };
struct passwd *passwdent;
while (*users) {
passwdent = getpwnam(*(users++));
printf("uid: %d\n", passwdent->pw_uid);;
}
return 0;
}