当我打字时,如何用'*'代替字符? [英] How can i put ' * ' instead of characters when i'm typing ?

查看:68
本文介绍了当我打字时,如何用'*'代替字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Wat我的意思是,当我们输入密码时,它只显示'''''怎么可能,我这样做但是我得到''*''作为输出....

然后我给''*''分配了带有ascii值的字符'''''。

但是我没有得到它怎么可能......

展开 | 选择 | Wrap | >行号

解决方案

从键盘读取的标准C和C ++回送字符。当你使用< conio.h>

http://en.wikipedia.org/wiki/Conio.h

你可以使用函数getch()读取没有回声的键盘 - 然后你可以自己回声。请注意< conio.h>是一个非标准的头文件,并不适用于某些编译器。


试试这个编码你会得到答案

展开 | 选择 | Wrap | 行号


Thanx你的回复indianraja和horace ...

但是Indianraja我在编译程序时有一些疑惑和错误,我使用的是turbo C ++和

展开 <温泉n class =codeDivider> | 选择 | Wrap | Line编号

Wat i mean is while we entering passwords it only shows '' * '' hows is it possible , i did that but i am getting '' * '' as output....
then i assigned '' * '' with char ''a'' with ascii values..
But i didnt get that how is it possible ...

Expand|Select|Wrap|Line Numbers

解决方案

standard C and C++ echo characters read from the keyboard. As you are using <conio.h>
http://en.wikipedia.org/wiki/Conio.h
you can use the function getch() which reads the keyboard without echo - you can then echo * yourself. Note that <conio.h> is a non standard header file and is not available with some compilers.


try this coding u wil get the answer

Expand|Select|Wrap|Line Numbers


Thanx for your reply indianraja and horace...
But Indianraja i have some doubts and errors while compiling the program , i am using turbo C++ and

Expand|Select|Wrap|Line Numbers


这篇关于当我打字时,如何用'*'代替字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆