Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1254252
  • 博文数量: 404
  • 博客积分: 10011
  • 博客等级: 上将
  • 技术积分: 5382
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-03 16:29
文章存档

2010年(40)

2009年(140)

2008年(224)

我的朋友

分类: LINUX

2009-02-26 15:37:55

getpass()

get password 

Function


#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.


prompt 

Points 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;
}


阅读(2966) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~