做了个很简单的密码输入程序,可以自定义输出字符
用法:- for %%i in ('password *') do echo %%i
- for %%i in ('password') do echo %%i
复制代码 源程序(C语言编写,某DEF说要用SetConsoleMode,可惜我没用):- #include <stdio.h>
- int main(int argc,char* argv[]){
- char c[65535],*p=c;
- while(13!=(*p++=getch()))fprintf(stderr,"%s",argc-1?argv[1]:"");
- *p=0;printf("%s",c);return 0;
- }
复制代码 下面这个没发上来,写下面这个程序完全为了避免YSL大大骂人..- #include <stdio.h>
- #include <malloc.h>
- int main(int argc,char* argv[]){
- char *c;
- unsigned long p=1;
- c=malloc(sizeof(char));
- while(13!=(c[p-1]=getch())){c=realloc(c,sizeof(char)*(++p));fprintf(stderr,"%s",argc-1?argv[1]:"");}
- c[p]=0;printf("%s",c);free(c);
- }
复制代码 链接: https://pan.baidu.com/s/1ES_jIRJoqc9dxg6WTJcvuw 提取码: 2fvr |