how to get * instead of characters while typing password? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how to get * instead of characters while typing password?

19th Jun 2016, 6:04 AM
Tanish Agarwal
Tanish Agarwal - avatar
6 Answers
+ 2
just giving the algorithm, declare a single char ch declare a string s getch(ch) int i=0 while ch!= (enter) or (space) { getch(ch) s[i++]=ch cout<<"*" } hope this helps
19th Jun 2016, 10:59 AM
Tushar Purang
+ 2
I have attached the class file here Note: I haven't taken care for special key like up/down key etc here is the link: https://drive.google.com/open?id=0B4YLt8CgLlkXYU1ONmRyQmdCU3c enjoy๐Ÿ˜ƒ๐Ÿ˜ƒ
19th Jun 2016, 12:32 PM
Abhishek Kumar
Abhishek Kumar - avatar
0
are you writing console program ??
19th Jun 2016, 7:34 AM
Abhishek Kumar
Abhishek Kumar - avatar
0
ya
19th Jun 2016, 8:01 AM
Tanish Agarwal
Tanish Agarwal - avatar
0
tushar nd abhishek thnx that really helped
19th Jun 2016, 6:00 PM
Tanish Agarwal
Tanish Agarwal - avatar
0
no problem ๐Ÿ˜ƒ just vote the answer thanks
19th Jun 2016, 6:58 PM
Abhishek Kumar
Abhishek Kumar - avatar