📄 password.c
字号:
#include <termios.h>#include <stdio.h>#define PASSWORD_LEN 8int main(){ struct termios initialrsettings, newrsettings; char password[PASSWORD_LEN + 1]; tcgetattr(fileno(stdin), &initialrsettings); newrsettings = initialrsettings; newrsettings.c_lflag &= ~ECHO; printf("Enter password: "); if(tcsetattr(fileno(stdin), TCSAFLUSH, &newrsettings) != 0) { fprintf(stderr,"Could not set attributes\n"); } else { fgets(password, PASSWORD_LEN, stdin); tcsetattr(fileno(stdin), TCSANOW, &initialrsettings); fprintf(stdout, "\nYou entered %s\n", password); } exit(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -