Borland C++ reference

getpass

raw OCR

Reads a password.

Defined in header <conio.h>

Syntax

#include <conio.h>
char *getpass(const char *prompt);

Portability

DOSUNIXWindowsANSI CC++ 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.