getpass
raw OCR
Reads a password.
Defined in header <conio.h>
Syntax
#include <conio.h>
char *getpass(const char *prompt);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
getpass reads a password from the system console, after prompting with the null-terminated string prompt and disabling the echo. A pointer is returned to a null-terminated string of up to eight characters (not counting the null-terminator).
Return value
The return value is a pointer to a static string, which is overwritten with each call.
See also
Example
#include <conio.h>
int mainO
{
char *password;
password = getpass ("Input a password:");
cprintf("The password is: %s\r\n", password);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/conio.h/getpass/
· short form /3.1/getpass/