#include <unistd.h> char *getlogin(void);
Get the login ID of the user.
Returns the value of the USER
environment variable, else the
LOGNAME
environment variable, else "dosuser"
.
not ANSI, POSIX
printf("I am %s\n", getlogin());
Go to the first, previous, next, last section, table of contents.