#include
#include
char *getpass(const char* prompt);
The getpass() function opens the process' controlling terminal, writes the specified prompt, disables echoing, reads a string of characters up to the next newline character or EOF, restores the terminal state and closes the terminal.
promptPoints to the prompt string to be displayed.
On success, getpass() returns a pointer to a null-terminated string of at most _PASSWORD_LEN bytes that was read from the terminal device. On error, it restores the terminal state and returns a null pointer.
UNIX 98.
Unsafe.
Use of this function is deprecated. It may be withdrawn in a future release.
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
C语言库函数 getpass
函数名: getpass
功 能: 读一个口令
用 法: char *getpass(char *prompt);
程序例:
#include int main(void)
{
char *password;
password = getpass("Input a password:");
cprintf("The password is: %s/r/n",
password);
return 0;
}